RequestDispatcher

Discussions

Web tier: servlets, JSP, Web frameworks: RequestDispatcher

  1. RequestDispatcher (1 messages)

    can we use RequestDispatcher to hit URL out of the current server..

    some thing like this

    RequestDispatcher dis_ = getServletContext().getRequestDispatcher("http://www.google.com/search?q=JSP").

    Thanks
    -Venu

    Threaded Messages (1)

  2. RequestDispatcher[ Go to top ]

    If you're using the ServletContext to retrieve a request dispatcher, you can only get them for named servlets or paths relative to the context root.

    There's nothing in the RequestDispatcher interface itself (AFAIK) that would stop it from being used from a remote site, but there's no way that I'm aware of to get one.

    If you were looking to perform a forward, though, you could use response.sendRedirect( ).