| Author |
Session handling in Spring
|
fu bace
Greenhorn
Joined: Oct 16, 2009
Posts: 24
|
|
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
internet detective
Marshal
Joined: May 26, 2003
Posts: 26173
|
|
|
In Spring, you would use an interceptor. In other MVC frameworks (or no framework), you'd likely use a filter.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
fu bace
Greenhorn
Joined: Oct 16, 2009
Posts: 24
|
|
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
|
 |
 |
|
|
subject: Session handling in Spring
|
|
|