@SessionAttribute annotation usage
The @SessionAttributes annotation can only be used on the definition of a class. The source code of this annotation is shown below
@SessionAttributes(types={User.class, Dept.class}) will add all attributes of type User and Dept in the model to the session, that is, the session scope.
@SessionAttributes(value={"user1", "user2"}) will add the attributes named user1 and user2 in the model to the session, that is, the session scope.
The variable name or variable type modified with @SessionAttributes will be added to the session scope at the same time as the request scope. Note that it is not only added to the session scope, remember to remember.