spring+mvc_返回json数据 406
来源:互联网 发布:nodejs 运行sql文件 编辑:程序博客网 时间:2024/06/05 18:08
1 .选择jar包不正确
2.servlet.xml 配置文件 问题 :
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<context:component-scan base-package="com.springmvc.controller" />
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<context:component-scan base-package="com.springmvc.controller" />
<bean
class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
<property name="mediaTypes">
<map>
<entry key="atom" value="application/atom+xml" />
<entry key="html" value="text/html" />
<entry key="json" value="application/json" />
</map>
</property>
<map>
<entry key="atom" value="application/atom+xml" />
<entry key="html" value="text/html" />
<entry key="json" value="application/json" />
</map>
</property>
<property name="viewResolvers">
<list>
<bean class="org.springframework.web.servlet.view.BeanNameViewResolver" />
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/pages/" />
<property name="suffix" value=".jsp" />
</bean>
</list>
</property>
<list>
<bean class="org.springframework.web.servlet.view.BeanNameViewResolver" />
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/pages/" />
<property name="suffix" value=".jsp" />
</bean>
</list>
</property>
<property name="defaultViews">
<list>
<bean
class="org.springframework.web.servlet.view.json.MappingJacksonJsonView" />
</list>
</property>
<list>
<bean
class="org.springframework.web.servlet.view.json.MappingJacksonJsonView" />
</list>
</property>
</bean>
<mvc:annotation-driven />
<mvc:annotation-driven />
</beans>
0 0
- spring+mvc_返回json数据 406
- spring 返回json数据
- spring mvc json数据返回
- Spring MVC返回JSON数据
- Spring Boot返回json数据
- Spring MVC返回JSON数据
- Spring MVC 返回json数据报406错误
- 使用spring-mvc 框架返回json格式数据 报406
- Spring MVC返回json数据的方法
- Spring MVC之返回JSON数据
- Spring MVC返回json数据的方法
- 封装Spring MVC 返回JSON 格式数据
- 关于spring mvc返回json数据
- Spring MVC中ajax返回json数据
- spring mvc ajax 请求返回json数据
- spring mvc如何返回json数据
- spring mvc返回json 类型的 数据
- (2)spring boot返回json数据
- 多线程以及并行开发
- C# Json
- Java实现二叉树的创建和遍历操作(有更新)
- Ajax 上传文件,返回JSON字符串在FireFox下解析带有<pre>标签的解决办法
- 第12周项目2——操作用邻接表存储的图
- spring+mvc_返回json数据 406
- 项目三-图遍历算法实现
- 什么是SOCKET
- dp与px的转换
- 第十二周--项目2操作用邻接表存储的图
- Spring面试题和答案
- 第11周 项目1 - 二叉树算法验证(3)
- redis 常用命令
- 苹果开源框架ResearchKit登陆GitHub