1 Reply Latest reply: Mar 2, 2011 6:43 AM by Opal RSS

    Request Dispatching

    mr_jaber
      Hi,

      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.

      Thanks,
        • 1. Re: Request Dispatching
          Opal
          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.