[jboss-user] [JBoss Portal] - Re: SHARING THE SESSION BETWEEN THE PORTLETS DEPLOYED AS SEP
do-not-reply at jboss.com
Fri May 9 19:25:43 EDT 2008
Here is what we have done to share data across different war files deployed on JBOSS portal.
There is one interesting thing that happens in Jboss Portal, i.e that it gives the same session ID to all the session objects created in different war files if request comes from the same client.
What it means is that we can create an external data holder which is accessible to all the war files deployed in portal and save and retrieve data from it using the session id.
Here is how it works:
1. Create a singleton class which is accessible to all the war files, keep it at shared class path .. i.e in /server/default/lib.
2. When a user logs in, we can save data that is to be shared in this singleton class against the session ID.
3. When a user visits pages from other war file, access the saved data from the singleton class by querying against the session ID of this war file.
4. Apply a session listener in portal-server.war file which cleans the data from singleton when a user logs out.
Only issue with this approach is that while doing session replication the data from the singleton will not shared across JVMs.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4149874#4149874
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4149874
More information about the jboss-user