Servlet Redirection

E

evgchech

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
 
R

Ralf Doering

evgchech said:
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
 
L

Lew

evgchech said:
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

<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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,219
Latest member
KristieKoh

Latest Threads

Top