springMVC笔记:@ResponseBody
使用@ResponseBody的方式,将Map形返回值转为json,用作POST请求的返回值。为了解决406 Not Acceptable错误,需要检查以下几项:
1. 依赖包中包含jackson-mapper-asl, jackson-core-asl
2.springmvc的xml文件中包含<mvc:annotation-driven />,bean的配置为
<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"
xmlns:aop="http://www.springframework.org/schema/aop"
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
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
最新文章
- 30分钟?不需要,轻松读懂IL
- Markdown语法说明(详解版)
- bower
- 2014.1.23 Discuz论坛迁移+VPS配置手记
- 无状态服务(stateless service)
- file not found while xcode archive
- OC班级类
- 暑假集训(3)第一弹 -----还是畅通工程(hdu1233)
- python常用的一些东西——sys、os等
- vb6.0 倒计时
- nodejs简单数据迁移demo
- 7年,OpenStack从入门到放弃|送书
- Javascript初识之流程控制、函数和内置对象
- 小程序之 swiper高度根据图片高度变化
- Mariadb Redis 的配置使用
- Python语言知识总结
- oauth2-server-php-docs 概念
- 用 C# 计算 与 java 一致的unix时间戳 (长时间整形 如:1476956079961)
- Codeforces 837D - Round Subset(dp)
- Html5音频播放
热门文章
- 二叉树 【转】http://blog.csdn.net/sjf0115/article/details/8645991
- 使用java去对比2个带数学公式的字符串
- Nginx下配置codeigniter框架
- HDU 4681 String 胡搞
- Problem 1036 四塔问题
- SqlHelper——数据库小助手
- 思梦PHP-阿里大鱼手机验证码
- 【bzoj2959】长跑 LCT+并查集
- Eclipse中一个Maven工程的目录结构 (MacOS)
- 详解Django-auth-ldap 配置方法