Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

best way to implement session handling

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
Ranch Hand
Posts: 247
MyEclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic