File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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!