开发者

spring MVC RedirectView [closed]

开发者 https://www.devze.com 2023-04-02 19:20 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and 开发者_Python百科 cannot be reasonably answered in its current f
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and 开发者_Python百科 cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号