This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Servlets and the fly likes A Question in ServletContext Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "A Question in ServletContext" Watch "A Question in ServletContext" New topic

A Question in ServletContext

Vasantha Prabha
Ranch Hand

Joined: Oct 02, 2003
Posts: 108
Can any one tell me why do we need

Regards,Vasantha<p>Great minds discuss ideas. Average minds discuss events. Small minds discuss people.
Kevin Jones
Ranch Hand

Joined: Oct 29, 2003
Posts: 39
The getContext method takes a string. This is the URI to a different ServletContext running within this container. Once you have this reference you can then call getRequestDispatcher on that context and dispatch requests to servlets running in other web apps. Now,
i) this is probably not a good idea
ii) Containers may prevent this for security reasons

Kevin Jones<br />Author: <a href="" target="_blank" rel="nofollow">Servlets and JSP: The J2EE Web Tier</a>
danny liu
Ranch Hand

Joined: Jan 22, 2004
Posts: 185
that means you wanna access a resource beneath another application.
be careful when you are doing do.
hope that helps.
I agree. Here's the link:
subject: A Question in ServletContext
It's not a secret anymore!