wood burning stoves 2.0*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "what is requestDispatcher" Watch "what is requestDispatcher" New topic
Author

what is requestDispatcher

Dharmender Singh
Greenhorn

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

Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

a request dispatcher implements the RequestDispatcher interface, which contains methods to dispatch a request. Methods like sendRedirect, forward... Check it at http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/RequestDispatcher.html


[My Blog]
All roads lead to JavaRanch
Ben Souther
Sheriff

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:
UseRealWords

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.
-Ben


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

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: http://aspose.com/file-tools
 
subject: what is requestDispatcher
 
Similar Threads
Use of getRequestDispactcher()
difference between RequestDispatcher from a ServletRequest and from a ServletContex
servlets
diff between redirect and requestdispatcher
absolute or relative