Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using network proxy settings in java program

 
igwe kalu kalu ogba
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I have a program , rather a jsp file which makes a connection to an outside server and then displays some information. I have to use the

System.setProperty( "proxySet", "true" );
System.setProperty( "http.proxyHost", "" );
System.setProperty( "http.proxyPort", "" );

With the adequate proxy settings filled in.
The problem here is that the proxy settings are set from a file called Proxy.xml. Before my http request executes, the file Proxy.xml is opened and the details for proxyHost and proxyPort are read and filled in automatically.

But if during the session (ie, while tomcat is running) , the file Proxy.xml is altered in some way, maybe the proxyHost is changed to a different and incorrect IP, the program still works , unless I restart tomcat.


My question is, How do I unset these proxy settings totally from my tomcat server or jsp file once a certain line of code is executed?
i.e, is there a System.unsetProperty or equivalent.

I've tried System.setProperty( "proxySet", "false" );

But it s
 
Manuel Moons
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure if this will work but try


Seems reasonable enough doesn't it?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic