This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
We have a struts web application which have a help link in that. Clicking on the help link opens another web app(also a struts app), which provides the help page. However, we have a requirement that whenever the main application(which has the help link in it) is closed(i.e. sesssion ends), the help page needs to be notified, so that its session ends too. I am not sure how to go about this. Will passing the JsesionId from the main page to the help app help in some way?
Any pointers regarding this would be a great help.
You might be able to deploy a version of a Single Sign On scheme for your applications. I believe, sessions would be maintained independently in each application but when one session becomes invalidated, all sessions linked by the Single Sign On get invalidated.
Another option would be to deploy a session listener that allows you to track sessions yourself in your main application. The main application might make a request to a super-secret URL on the Help application when a session is invalidated telling the Help application which session just died. On the servlet living on the Help application you would then invalidate the Help application's session associated with the one that died on the main application. With this option passing some unique ID (why not the jsessionid?) to the Help application could be used to link the user in the main app with the user in the help app. Of course you would also have to maintain your own list of sessions in the Help application, mapped to the ID passed from the main app.