美文网首页寻找问题的原因
maven项目资源访问不了 getHandlerInternal

maven项目资源访问不了 getHandlerInternal

作者: KardelShaw | 来源:发表于2018-01-26 17:41 被阅读0次

加了default不管用

<mvc:default-servlet-handler />

可以确认DispatcherServlet确实把请求拦截了,但是没有找到后没有转发给DefaultServletHttpRequestHandler,原因尚未明确。

查找资料后找到解决方案:

<mvc:resources location="/WEB-INF/js/**" mapping="/js/**"></mvc:resources>

改为

<mvc:resources location="/WEB-INF/js/" mapping="/js/**"></mvc:resources>

参考文章:

Did not find handler method for springMVC资源文件扫描不到---关于spring的那些坑

相关文章

网友评论

    本文标题:maven项目资源访问不了 getHandlerInternal

    本文链接:https://www.haomeiwen.com/subject/agywaxtx.html