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.
I am developing an application in struts 2 and i want to know what is the best way to implement session handling.
There is a login page in which when i login i get acess to various pages like add, remove, etc.
If user tries to access this pages without login or if session has expired he should be redirected to login page.
What should i do to implement this?
should i use normal cookies check on all pages or should i use interceptor for this or is there any other better way. (session handling)
i think interceptor would be the better option for you, because adding checks on each page would be cumbersome,so its better that you implement a login interceptor and reference it as default interceptor for the actions in struts.xml. this will redirect any unauthorised user to the login page. If you have any query let me know.
A small leak can sink a Gigantic ship.>