• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session handling in Spring

 
fu bace
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I have a question about user session handling in Spring or any Mvc.

For example when user succesfully logins to site i will set a session to this user which helps me to understand whether the user is logged or not.
The question is where can i do this session check operation. Checking the session attribute in every Controller sounds like funny. So what is the best way to handle users sessions in Spring.

Thanks for any help.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34965
377
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Spring, you would use an interceptor. In other MVC frameworks (or no framework), you'd likely use a filter.
 
fu bace
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for pointing.

A simple but a good example can be found here.

http://spidercatch.blogspot.com/2009/02/interceptors-in-spring-and-struts-2.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic