`

freemaker,生成了静态文件,转发该文件时候出错404

 
阅读更多

报错,已经生成了 静态文件,转发该静态文件出现404,错误如下:
[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]Did not find handler method for [/staticPage/test-simple2testtestHtml_zh_CN.html]

[org.springframework.web.servlet.PageNotFound]No mapping found for HTTP request with URI [/test-simple2/staticPage/test-simple2testtestHtml_zh_CN.html] in DispatcherServlet with name 'SpringMVC'

解决办法:资源被拦截了,所以不能访问

1、在该静态文件夹在项目里建一个,如:staticPage

2、在spring-mvc.xml 添加

       <!-- 资源过滤 -->

    <mvc:resources mapping="/staticPage/**" location="/staticPage/" />

 

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics