This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi again all. I am working on my struts app and I now want to put in a mechanism to handle timeouts. When a user leaves their application for the timeout time, if they click on anything I want them to be redirected to the login page. I have a value that I put in session that I check for to see if the user is logged in/that they have been authenticated. The value is only put in after all authentication. My question is it there an easy way to intergrate this into my application ? That is to say would it be possible to subclass action and place this test in it and then change all my actions to extend my newly subclassed Action class ? Or would it be better to simply place all of these tests in each Action (this seems quite ugly and does not make good code re-use at all )
I am open to any other suggestions or ideas that anyone might be able to give.
Extend the RequestProcessor class and override the processPreprocess method to check if the session is valid. If not valid redirect to the Login Page.
Hope this helps.
Thanks and Regards, Arul.
Joined: Aug 23, 2006
Thanks for the suggestion, but I had actually tried that and it didn't seem to work. I couldn't even get a test message to appear in my logs. Is there anything else that one has to do other than extend RequestProcessor ?