File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes what is requestDispatcher Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "what is requestDispatcher" Watch "what is requestDispatcher" New topic

what is requestDispatcher

Dharmender Singh

Joined: Jun 14, 2007
Posts: 16
what is the difference b/w sendRedirect and requestDispatcher

Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

a request dispatcher implements the RequestDispatcher interface, which contains methods to dispatch a request. Methods like sendRedirect, forward... Check it at

[My Blog]
All roads lead to JavaRanch
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Dharmender Singh,
Welcome to JavaRanch!

In an effort to help you get the most from our forums, we've compiled a
list of tips for asking questions here. You can find the list in our
FAQ section here.
In particular please see:

Abbreviations such as "u" or "ur" in
place of "you" and "you are" or "you're" confound language translation software making
it hard for our non-English speaking members to read your posts.

Again, welcome to JavaRanch and good luck with your question.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Dharmender Singh

Joined: Jun 14, 2007
Posts: 16
in send redirect the new response object will be sent but in forward coming req res objects will be forwarded
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
There is no need to post the same message twice.In case you have done os , you can delete one of the messages.

sendRedirect works on the client side.The server sends the browser the URL to which it needs to connect.The browser then makes a fresh connection with the URL.

RequestDispatcher works on the server side.Look for servlet documentation for more information.

Try searching javaranch .This questions has been asked quite a few times before too.

Rahul Bhattacharjee
LinkedIn - Blog
I agree. Here's the link:
subject: what is requestDispatcher
It's not a secret anymore!