This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sharing session between different application

 
Shanmuga Raja
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we have the session object shared between different application running in the apps server..say for example weblogic..?

Thanks
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34839
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shanmuga,
No. Sharing sessions across application goes against the specification.
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use EJB then I believe it is possible.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no, it's not possible with EJB either.
2 web applications can call the same EJB which (if stateful) may be called in such a way that it uses the same EJB instance with the state left behind by the other web application but they will not share a single HttpSession.
And don't think passing the session from one webapp to another via an EJB will help you, it won't. The data referred to in that session will be useless in the webapp you pass it to and if you try to use its session ID you're in for a load of trouble.
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was not meant to say that you can pass session object itself between diff application.

You can pass information between different application running on the same / different servers using EJB.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic