SpringMVC请求转发WEB-INF下静态页面404问题

页面报错:

HTTP Status 404 – Not Found
Type Status Report

Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

Apache Tomcat/8.5.39

success放置在WEB-INF下
通过请求转发可以访问,而通过重定向会出现404报错,因为请求转发是在服务器内部实现的,自然可以访问WEB-IF下的静态页面,而重定向会打回请求会重新发起,即冲客户端请求WEB-INF,自然获取不到

实际操作时候,如果真的需要访问,可以通过servlet的转发请求、springmvc或者struts2进行处理,原理都是从服务器内部访问

你可能感兴趣的:(SpringMVC请求转发WEB-INF下静态页面404问题)