解决spring mvc No mapping found for HTTP request with URI错误的三种方法
来源:互联网 发布:淘宝新手卖家被骗 编辑:程序博客网 时间:2024/06/05 22:51
1、控制层没有被spring扫描到,控制层没有实例化,检查自己的控制层是否被spring扫描到,检查以下配置:<context:component-scan base-package=""/>
2、web.xml配置文件的<url-pattern>标签配置成<url-pattern>/*</url-pattern>,正确的配置应该是<url-pattern>/</url-pattern>。学了structs之后再学spring mvc框架的 就会很容易犯这个错误。
3、使用的是注解实例化控制层,且web.xml的路径配置为<url-pattern>/</url-pattern>,却没有在spring的配置文件使用<mvc:annotation-driven />标签,导致URL解析出错,检查是否加上<mvc:annotation-driven />。
当我们需要controller返回一个map的json对象时,可以设定<mvc:annotation-driven />,
同时设定<mvc:message-converters> 标签,设定字符集和json处理类,例如:
<mvc:annotation-driven>
<mvc:message-converters>
<bean class="org.springframework.http.converter.StringHttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>text/plain;charset=UTF-8</value>
</list>
</property>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
- 解决spring mvc No mapping found for HTTP request with URI错误的三种方法
- 解决spring mvc No mapping found for HTTP request with URI错误的三种方法
- Spring MVC No mapping found for HTTP request with URI
- Spring MVC------No mapping found for HTTP request with URI
- Spring mvc No mapping found for HTTP request with URI
- 解决 No mapping found for HTTP request with URI的方法
- spring mvc page not found no mapping found for http request with uri
- No mapping found for HTTP request with URI完美解决
- spring No mapping found for HTTP request with URI
- spring mvc No mapping found for HTTP request with URI [] in DispatcherServlet
- Spring 3 MVC No mapping found for HTTP request with URI (转)
- java spring mvc Error:No mapping found for HTTP request with URI
- spring管理事务失效的原因和No mapping found for HTTP request with URI []DispatcherServlet with name 'sprinmvc错误
- 不一样的No mapping found for HTTP request with URI
- 深恶痛绝的No mapping found for HTTP request with URI
- Spring MVC的简单案例报错:警告: No mapping found for HTTP request with URI [/springMVC/hello2] in DispatcherSe
- 恼人的No mapping found for HTTP request with URI解决了
- maven+spring 遇到No mapping found for HTTP request with URI的问题
- Mixture of Gaussian(高斯混合原型聚类)
- 网关
- 1006. 换个格式输出整数 (15)
- Maven入门
- lex & yacc
- 解决spring mvc No mapping found for HTTP request with URI错误的三种方法
- Tensorflow手写数字识别
- 栈的压入、弹出序列
- 嵌入式软件开发QT-00-win10+qt591+qtcreator431环境配置
- 【末世旅行之渗透测试】Windows创建隐藏克隆用户
- python爬虫 ajax请求初使用 豆瓣电影
- python 目录,文件 操作
- 数据库五大约束条件
- 【bzoj1232】[Usaco2008Nov]安慰奶牛cheer