简体   繁体   中英

How to manage user session in Spring MVC

I am migrating java struts 1.1 application to Spring MVC. I have a question about how to handle user session, multiple users concurrently can log in and use this application. Which is normal for any application. Do I need to take care of anything specifically to manage user sessions just to make sure one user's activity should not be updating other user's activity/data. I will be using the bean scopes as it is in spring mvc style.

Any suggestions on this please?

Kiran

Spring MVC just like Struts are based on Servlets and need to handle user session the same way. You can access HttpSession in Spring Controller using RequestContextHolder or just declare it as parameter in your controller method.

You use HandlerInterceptorAdapter and Spring Security Session management. HTTP Session management is very important. Spring already provided.

HandlerInterceptorAdapter

Spring Security Session management

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM