*
The moose likes Servlets and the fly likes Does the refrence to another web resource needs to be within same servlet context? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Does the refrence to another web resource needs to be within same servlet context?" Watch "Does the refrence to another web resource needs to be within same servlet context?" New topic
Author

Does the refrence to another web resource needs to be within same servlet context?

Mathew Lee
Ranch Hand

Joined: Jun 08, 2009
Posts: 238
Hi,

I read

'RequestDispatcher interface encapsulates a reference to another web resource at a specified path within the scope of same Servlet context.'

I am bit congfused about above statement. Does the refrence to another web resource needs to be within same servlet context?.

Any ideas, suggestions, links, sample code highly appreciated. thanks in advance
avi sinha
Ranch Hand

Joined: Mar 15, 2009
Posts: 452

gudim gudi wrote:Hi,
I am bit congfused about above statement. Does the refrence to another web resource needs to be within same servlet context?.


yes for RequestDispatcher the reference to web resource must be within the same Context.

avi sinha


SCJP 5.0 SCWCD 5.0
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

You can get a ServletContext object of another context using ServletContext.getContext method and then get a RequestDispatcher on that ServletContext ...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Does the refrence to another web resource needs to be within same servlet context?
 
Similar Threads
ActionForward redirecting to a page in another servlet context
javascript src path
Accessing different WAR resources
difference between Jsp forward and sendRedirect
I am not getting K&B page 445