my dog learned polymorphism*
The moose likes Servlets and the fly likes Sharing session across servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Sharing session across servlets" Watch "Sharing session across servlets" New topic

Sharing session across servlets

Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

Is it possible to share sessions across servlets running in two different servlet contexts? If yes, how?
- Manish
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
Not using the regular session mechanism. The route most people take is to persist the data which you need to share in some sort of repository reachable by servlets in both contexts (a database, JNDI repository, JavaSpace, etc.).

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

I thought so...
- Manish
It is sorta covered in the JavaRanch Style Guide.
subject: Sharing session across servlets
Similar Threads
Search Engine
Servlet reuse across context?
Servlets in different containers
is abstract class instance variable in servlet container - thread-safe
Sharing Static Objects