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.>
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads