1 Reply Latest reply on Mar 2, 2011 12:43 PM by Opal

    Request Dispatching


      How can i dispatch the request that is coming to my servlet (or any other web web component) to an external link (out side my context) like "http://www.google.com" after setting a header variable.

      i have tried wrapping the request and using the RequestDispatcher but it seems that its not working for external links.

        • 1. Re: Request Dispatching
          Of course it's not working for external links. Servlet is enclosed in a servlet container (a sort of a sandbox) so how could it dispatch the incoming request to the external server? Also look at the docs:

          "Defines an object that receives requests from the client and sends them to any resource (such as a servlet, HTML file, or JSP file) on the server".

          Google for "java proxy servlet", and implement one of the found solutions.