简体   繁体   中英

how to declare a variable in session scope using spring MVC

I want a variable which is updating dynamically and should be in session scope. i am using spring MVC. when i declared the variable in controller class as class variable the variable is getting updated across all users looks like in application scope. I want that should be updated individually.

suppose if am using a counter to increment initially the value is 0. user A logged in and the variable value is updated to 1. if user B logged in and the variable value is updated to 2 which should be updated to 1 only(as per my requirement) i want the variable value in session scope.

您可以创建一个包含ListSession Scoped bean或将List设置为HttpSession属性。

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