aspose file tools*
The moose likes Servlets and the fly likes RequestDispatcher in servletcontext Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "RequestDispatcher in servletcontext" Watch "RequestDispatcher in servletcontext" New topic
Author

RequestDispatcher in servletcontext

Thamarai kannan
Greenhorn

Joined: May 05, 2009
Posts: 28

hi can any one give brief description with source for the following question

getRequestDispatcher(String path) of the ServletRequest interface cannot extend outside the current servlet context whereas getRequestDispatcher(String path) of the ServletContext can use the getContext(String uripath) method to obtain RequestDispatcher for resources in foreign contexts.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3775

By using ServletContext.getContext() (for the getRequestDispatcher()) servlets can gain access to the resources in other contexts hosted in the same server. But with the ServletRequest.getRequestDispatcher() servlets get the access only to local resources inside the same context as the current request. Check the API for ServletContext.


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Thamarai kannan
Greenhorn

Joined: May 05, 2009
Posts: 28
k thanks alot...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RequestDispatcher in servletcontext
 
Similar Threads
Servlet to servlet
problem with RequestDispatcher
Correct answer
RequestDispatcher and thread-safe
java.lang.IllegalArgumentException