上QQ阅读APP看书,第一时间看更新
Session attributes
All the attributes and values that we discussed until now are used within a single request. However, there might be values such as a specific web user configuration that might not change across requests. These kinds of values will typically be stored in an HTTP session. Spring MVC provides a simple type level (class level) annotation @SessionAttributes to specify the attributes that would be stored in the session.
Take a look at the following example:
@Controller
@SessionAttributes("exampleSessionAttribute")
public class LoginController {