Hello
I need to redirect user request within servlet to another servlet
without sending response.redirect to the client.I now that ASP for
example has Server.Transfer function that transfers the requet to
another asp page without sending 302 to the client.I need the same
functionality in JSP/Servlets
Please help
Ralf Doering - 19 Jul 2007 14:27 GMT
> I need to redirect user request within servlet to another servlet
> without sending response.redirect to the client.I now that ASP for
> example has Server.Transfer function that transfers the requet to
> another asp page without sending 302 to the client.I need the same
> functionality in JSP/Servlets
Are you looking for something like RequestDispatcher#forward?
See
http://java.sun.com/javaee/5/docs/tutorial/doc/Servlets9.html#wp64709
for an example.
HTH,
Ralf
Lew - 19 Jul 2007 14:34 GMT
> Hello
> I need to redirect user request within servlet to another servlet
[quoted text clipped - 3 lines]
> functionality in JSP/Servlets
> Please help
<http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/RequestDispatcher.html>
It's obtained via an idiom like:
RequestDispatcher rd
= request.getRequestDispatcher( "path-within-app/otherServlet" );
The dispatch (not called "redirection") happens on the server side.

Signature
Lew