Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2007

Tip: Looking for answers? Try searching our database.

Servlet Redirection

Thread view: 
evgchech - 19 Jul 2007 13:51 GMT
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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.