Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

best way to implement session handling

 
ankurshah shah
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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)
 
Raza Mohd
Ranch Hand
Posts: 247
Java MyEclipse IDE MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ankurshah,
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.

regards
Raza.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic