Hi Skaffman,
I basically have this confusion on how to implement session management in Spring?
Is this how spring session management is properly done in Spring? This is where we get
session object from request and then properly set or remove attributes?
public class LoginController extends SimpleFormController {
public ModelAndView onSubmit(HttpServletRequest request,
HttpServletResponse response, Object command, BindException errors) {
HttpSession session = request.getSession();
User user =
(ArrayList)session.getAttribute("userInfo");
if (user == null) {
user = new ArrayList();
session.setAttribute("userInfo", user);
}
//other code here
return new ModelAndView(new RedirectView(getSuccessView()));
}
}
I got confused actually when I have read about session scope beans in the spring documents?
I am not sure if they are used in Spring Web MVC.
Kindly enlighten me on this. Thank you