No mapping found for HTTP request with URI

来源:互联网 发布:8管脚单片机 编辑:程序博客网 时间:2024/06/18 11:50

spring-mvc.xml 文件没有注入controller类

<!-- 自动扫描该包,使SpringMVC认为包下用了@controller注解的类是控制器 -->
<context:component-scan base-package="com.rinlink.intelligent.controller" />

参考网址

http://www.cnblogs.com/qwcbeyond/p/4948586.html


添加这么一段过滤,又出现No mapping found for HTTP request with URI

<mvc:resources location="/" mapping="/**/*.html" />
<mvc:resources location="/" mapping="/**/*.js" />
<mvc:resources location="/" mapping="/**/*.css" />
<mvc:resources location="/" mapping="/**/*.png" />
<mvc:resources location="/" mapping="/**/*.gif" />
<mvc:resources location="/" mapping="/**/*.ttf" />
<mvc:resources location="/" mapping="/**/*.woff" />
<mvc:resources location="/" mapping="/**/*.woff2" />


解决办法就是:

添加一行

<mvc:annotation-driven />

阅读全文
0 0
原创粉丝点击