I need to share some session objects between two war files on the same server. How can I get this done??? I have two war files service.war and retiree.war, You log into the Application from service.war, and set some session atributes such as the DBname, type, userid and a host of other attributes. All my JSPs and servlets in the retiree.war need this attributes. I am having trouble sharing the same session between both apps. Help please! By the way I am using a JBoss server.
SCJP 1.4, SCWCD 1.4
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
- Martin Fowler et al, Refactoring: Improving the Design of Existing Code, 1999
Paul Sturrock if it is not possible to share the same session across both webapps, is there a way I can make the retiree.war a module of service.war without having to put the content of retiree.war into the main application service.war?
What I am trying to accomplish is to have a web application that manages human resources in service.war and then have an optional package retiree.war that would only be distributed on request as a plus. I guess I will have to resort to just placing the contents of retiree.war in a separate folder inside service.war...
service.war - /WEB-INF - /retiree
Instead of service.war & retiree.war, side by side.
What kind of session objects you'd like to share? If it's just logged user credentials, then you can use single sign on approach. You can also pass data using HTML form hidden object, HTTP cookies and some other technique. If you know upfront servlet container where your apps will run on, then you can use some servlet container undocumented capabilities to share session objects.