File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "RequestDispatcher" Watch "RequestDispatcher" New topic


Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 751
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
David O'Meara

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.

David O'Meara

Joined: Mar 06, 2001
Posts: 13459

There is one here
wood burning stoves
subject: RequestDispatcher
jQuery in Action, 3rd edition