LAMS constructs by many web applications. In order to sharing information among them, LAMS provides a mechanism to simulate HttpSession but across multiple web applications environment.
How to use LAMS shared session
Initialize system environment
The simple way to do this is run "copyfiles" target in LAMS_build ant script. This target will copy corresponding configuration files:
- Copy jboss-service.xml to ${JBoss}/server/default/conf folder.
- Copy context.xml to ${JBoss}/server/default/jbossweb-tomcat55.sar folder.
- Copy lams-session.jar to ${JBoss}/server/default/lib folder.
Add filter in your web.xml file
Get shared session instance:
SessionManager returns a HttpSession instance. You can use it like a true HttpSession except:
- Its values are shared across all web applications.
- HttpSession.isNew() method is invalidate.
- HttpSession.getServletContext() method is invalidate.
Limitation
- This solution relies on Cookies, so client browser must support cookies.
- Currently, all web applications which need use this solution must be deployed in one JVM.