Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to share session among web applications  RSS feed

 
Raghunath Nandyala
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ALL,
Is it possible to share servlet session among applications in same container.

thanks
raghu
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Raghunath Nandyala:

Is it possible to share servlet session among applications in same container.



Not Possible
 
Raghunath Nandyala
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any work around ?
Actually I'm working on one portal application, we got this kind of requirement..
As per my google,it's not possible..

raghu
[ October 31, 2008: Message edited by: Raghunath Nandyala ]
 
Raghavan Muthu
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about giving a try with Serialization of the Session Objects?
 
tapeshwar sharma
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Is it possible to share servlet session among applications in same container.

I don't think "servlet" session can be shared.
However, you can have a User Session shared across multiple web applications.
In one of my previous projects, we used to write user attributes to a cookie through a central application.
All secured applications were routed through this central one and the cookie was accessed to retrieve the user session attributes.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about giving a try with Serialization of the Session Objects?


NO - because HttpSession objects are managed by the servlet container.

Instead, write a Serializable custom Java object to hold all you need to share between applications and share that object between applications. Serialization to a file works surprisingly fast.

Bill
 
Raghavan Muthu
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by William Brogden:


NO - because HttpSession objects are managed by the servlet container.

Instead, write a Serializable custom Java object to hold all you need to share between applications and share that object between applications. Serialization to a file works surprisingly fast.

Bill


Bill, thank you. I exactly meant the same but I guess my statement was confusing. Though should have been more explanatory, thought of just giving a hint!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!