spring MVC RedirectView [closed]
return new ModelAndView(new RedirectView("login.htm"),"message","Your session has expired. Please login");
how do i get this message in login.jsp
<%request.getAttribute("message"); %>
${message}
any of above options didnt work
I guess since you're redirecting the model will not be available (redirect sends a 302 to browser and browser makes separate request for new page). but you can pass message as a URL parameter or store in the session.
精彩评论