servet session context sharing in JBoss

K

Kieron Briggs

Hi all,

Does anyone know of a way to share a servlet context between two web
applications packaged in separate EAR files? I would like to be able to
access, for example, a session-scoped javabean from both applications,
and allow the user to seamlessly switch back and forth with their
session intact.

I'm using JBoss 3.2.5, if it makes any difference.


Thanks in advance,

Kieron Briggs,
Web Admin, http://www.andrewwilkie.org.au/
Proudly a member of the Ryde Epping Greens
 
K

Kieron Briggs

Kieron said:
Does anyone know of a way to share a servlet context between two web
applications packaged in separate EAR files? I would like to be able to
access, for example, a session-scoped javabean from both applications,
and allow the user to seamlessly switch back and forth with their
session intact.

Found a workaround: using session.getServletContext().getContext() to
get a known context, one application pushes its bean into that context
(with its session ID as part of the name), and links to the second
application have the session ID appended to the URL. The second
application can then find that known context and use the session ID it
was passed to retrieve the bean.

It's kind of a hack, but it should work. Just thought I'd reply to
myself in case anyone else encounters a similar situation...



Kieron Briggs,
Web Admin, http://www.andrewwilkie.org.au/
Proudly a member of the Ryde Epping Greens
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top