Meaningless Drivel is fun!*
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
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: RequestDispatcher