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

Regarding Request Dispatcher

Damodara Reddy
Ranch Hand

Joined: Feb 09, 2007
Posts: 44
Is there any difference between getting a RequestDispatcher
using getRequestDispatcher(String uri) which is in ServletContext interface
and getRequestDispatcher(String uri)which is in ServletRequest.

I know the one difference... that is uri takes the path relative to the Context path in the first method, and in second method it takes either Context or request. Apart from this is there any the way RequestDispatcher works...?

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63839

Was the entry in the Servlet FAQ not helpful?

[Asking smart questions] [About Bear] [Books by Bear]
Damodara Reddy
Ranch Hand

Joined: Feb 09, 2007
Posts: 44
In servlet FAQ's I found the same difference which I mentioned above.
Any Other difference apart from that?
Kindly let me know.

Ben Souther

Joined: Dec 11, 2004
Posts: 13410

The best place to go for "difference between" questions is the API.

There are 3 links under the "See Also" section of this page that should have the answers to your question.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Damodara Reddy
Ranch Hand

Joined: Feb 09, 2007
Posts: 44
Thanks Ben Souther for your valuable reply .

I agree. Here's the link:
subject: Regarding Request Dispatcher
It's not a secret anymore!