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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Session accessing across multiple contexts" Watch "Session accessing across multiple contexts" New topic

Session accessing across multiple contexts

Naveen kn

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.

Ben Souther

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

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

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.
I agree. Here's the link: http://aspose.com/file-tools
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