You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.
| Online: | 23 Members of 4546 |
| Forum: Seam Users |
27. Aug 2008, 01:44 CET | Link |
Hello,
I have been trying unsuccessfully to figure out a clean way to do the following with the Seam Framework:
- Display a your session has timed out
message on the login page when a user is redirected there for the reason that their session has timed out.
There are several similar forum requests and blog posts attempting to address this functionality within Seam, but none work well, if at all.
As I understand Seam Scopes, the Scope of any Bean that can or should hold such a message is ScopeType.SESSION. The problem is that in the course of invalidating the session with Identity.instance().logout();, all the Session-scoped Beans will be cleared out (and reloaded), including the one that is holding the timeout message meant for the login page.
So let me pose the question:
- How do I persist a FacesMessage throughout Session invalidation so that it is still available when the login page is rendered?
I am open to any solution that utilizes the Seam Framework, rather than cookies or security-risk JavaScript. Exceptions, Events, or anything else that works would be much appreciated.
I can post my attempts to create a solution upon request, but I doubt that this will be of help. Please let me know if you would like more info or details.
Thank you in advance,
Jake
Postscript:
It need not be a FacesMessage - I just need a vehicle/semaphore/Event/Exception of some sort that can be passed from the about-to-be-expired session to the new session created when the login page loads, so that the login page knows whether or not to display a message.
Thanks!
Here is some stuff I have read and tried:
https://jira.jboss.org/jira/browse/JBSEAM-2257 (the patch, namely)
http://www.seamframework.org/11290.lace
http://solutionsfit.com/blog/2007/11/16/session-expired-messages-using-seam-security/
http://docs.jboss.org/seam/2.1.0.BETA1/reference/en-US/html/events.html#d0e4746
and Seam @Observer, to listen whenever the session has timeout to throw the message:
http://docs.jboss.org/seam/2.1.0.BETA1/reference/en-US/html/annotations.html#d0e23354
Best regards,
Joshua
Visit my blog.