This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Servlets and the fly likes Inter-servlet communication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Inter-servlet communication" Watch "Inter-servlet communication" New topic

Inter-servlet communication

Gareth Western
Ranch Hand

Joined: Apr 07, 2004
Posts: 45
Hi all,
I've written a servlet which adds an object to a new attribute in the ServletContext. What are the conditions to be able to access that ServletContext from a different servlet?
Abdul Narayan D'souza TP

Joined: Apr 01, 2004
Posts: 10
Yo Gareth,
There is one context per "web application" per Java Virtual
Machine.Therefore whenever u call ServletConfig.getServletContext() from
any servlet in an application(context) u get the same object.
I agree. Here's the link:
subject: Inter-servlet communication
It's not a secret anymore!