Specific description of the problem
- Redirected to the page can not be accessed under the WEB-INF
- After you submit the login form into the WEB-INF use when the request is forwarded
- After the request is forwarded to refresh the page will re-submit the form
- So that even after the return of the Log will log in directly refresh the page again
Solution
Redirect to a method of forwarding the request
The original method
@RequestMapping("/login") public String login(){ return ("admin/index");//请求转发到登陆后的主页 }
ways to improve
@RequestMapping("/login") public String login(){ return ("redirect:/system/toLogin");//重定向toLogin链接 } @RequestMapping("/toLogin") public String toLogin(){ return ("admin/index");//请求转发到登陆后的主页 }