Need a small help.

        wrote is a servlet which has makes a HTTP get request to the outside
intranet

        The main function of servlet is to get the resource(like some html files
on internet ), in the servlet iam creating a url connection, and in order
        to get the contents of resource from the internet it should pass through
our local http proxy server. in order to achieve  this the follwing code
was
        added

        System.getPoperties().put("proxySet", "true");
        System.getPoperties().put("proxyHost", "proxyServerName");
        System.getPoperties().put("proxyPort", "proxyportno");

        in the servlet.

        Up to this Everything is Working Fine.

        What Actually i require is i want to unset the proxy server settings
dynamically( depending up on the request )
        in order to unset the proxy settings i added following code to my servlet

        System.getPoperties().remove("proxySet", "true");
        System.getPoperties().remove("proxyHost", "proxyServerName");
        System.getPoperties().remove("proxyPort", "proxyportno");

        ( removed all the proxy related properties )

        invoke the servlet as http://hostname/servlet/myservlet?strurl=param

        where param can have values like

                                 1 )           http://www.xml.com                 -   
proxy should be
set
                                 2 )        http://www.javasoft.com/      -   proxy 
should be set
                                 3 )        http://148.171.39.56:7777/test/test.html  
- proxy should
not be set for this ( bypass proxy ) ( sample url )



        the problem what iam facing is the, if the first parameter ( for eg if iam
giving (1) ) then it is coming fine by going through proxy and the next
time when iam accessing the servlet by giving the (3) ( as
http://hostname/servlet/myservlet?strurl=resource3 ) for which iam
unsetting  the proxy properties, then am not able to get the required file.

        Please Help me in this regard.

        Any help would be greatly appreciated.

        Thanks a lot
        Mahesh

____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to