This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes Session accessing across multiple contexts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Session accessing across multiple contexts" Watch "Session accessing across multiple contexts" New topic
Author

Session accessing across multiple contexts

Naveen kn
Greenhorn

Joined: May 16, 2005
Posts: 2
Hi All
I have 2 applications running on tomcat on different contexts.
i have a link in context 'A' which calls a jsp page in context 'B'.

I am trying to access certain session variables of context 'A' in this context 'B's jsp.
It is returning null.

Can anybody explain if i can access variables like this.

Thanks
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

You can not (easily anyway).
Sessions are not meant to be shared across contexts.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Naveen kn
Greenhorn

Joined: May 16, 2005
Posts: 2
Even if there is a workaround please let me know

Thanks
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
I heard some application servers provide this feature but it would be application server specific then. Nothing for sure.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Session accessing across multiple contexts
 
Similar Threads
EL and Variables in JSP
getting session values in servlet, created in jsp
About sessions
sendRedirect Vs requestdispatcher.forward
using Lucene/servlets/jsps