File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes RequestDispatcher Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "RequestDispatcher" Watch "RequestDispatcher" New topic
Author

RequestDispatcher

Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
What's the use of it? I've seen people use it to forward a user to another page... But I've also seen many people not use it and just use the response.sendRedirect() method provided by the response object in the servlet doPost() and doGet() methods. What's the purpose of RequestDispatcher? Thanks!


SCJP 1.5
http://devpinoy.org/blogs/lamia/ - http://everypesocounts.com/
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

You should search this forum for threads comparing foward and sendRedirect, this should answer your question.

If I get a chance I'll see if I can find a good one for you.

Dave
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

There is one here
 
Consider Paul's rocket mass heater.
 
subject: RequestDispatcher