http://jadethao.iteye.com/blog/1926525
http://jadethao.iteye.com/blog/1926525
——————————————————————————————————————————————————————————————————
- @RequestMapping(value="/list",method=RequestMethod.GET,produces=MediaType.APPLICATION_JSON_VALUE)
- @ResponseBody
- public List<EditTimeout> list(){
- List<EditTimeout> list = editImpl.selectAll();
- return list;
- }
请求,debug跟踪list是返回值没有问题,但是前台页面报如下错误:
- Response Status: 406 (Not Acceptable)
Response RAW返回值如下,(前半部分)
- HTTP GET http://127.0.0.1:8080/onlineLibrary/rest/system/editTimeout/list
- Host: 127.0.0.1:8080
- 406 Not Acceptable
- Date: Sat, 17 Aug 2013 11:01:07 GMT
- Server: Apache-Coyote/1.1
- Content-Length: 1067
- Content-Type: text/html;charset=utf-8
- <html><head><title>Apache Tomcat/7.0.34 - Error report</title><style>
后台提示错误:
- 2013-08-17 19:01:03,116 DEBUG org.springframework.web.servlet.DispatcherServlet -Last-Modified value for [/onlineLibrary/rest/system/editTimeout/list] is: -1
- 2013-08-17 19:01:07,606 DEBUG org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver -Resolving exception from handler [public java.util.List<com.online.ol.filter.EditTimeout> com.online.ol.filter.EditTimeoutContoller.list()]: org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation
- 2013-08-17 19:01:07,680 DEBUG org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver -Resolving exception from handler [public java.util.List<com.online.ol.filter.EditTimeout> com.online.ol.filter.EditTimeoutContoller.list()]: org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation
- 2013-08-17 19:01:07,681 DEBUG org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver -Resolving exception from handler [public java.util.List<com.online.ol.filter.EditTimeout> com.online.ol.filter.EditTimeoutContoller.list()]: org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation
引起的原因:
由于设置了@ResponseBody,要把对象转换成json格式,缺少转换依赖的jar包,故此错。
解决办法:
加入依赖的jar,jackson-core-asl-1.9.12.jar,jackson-mapper-asl-1.9.12.jar问题解决。
- jackson-mapper-asl-1.9.12.jar (762.1 KB)
- 下载次数: 594
- jackson-core-asl-1.9.12.jar (226.8 KB)
- 下载次数: 475
http://jadethao.iteye.com/blog/1926525的更多相关文章
- [z]oracle优化http://jadethao.iteye.com/blog/1613943
[sql] view plaincopy SQL> create table t as select 1 id,object_name from dba_objects; Table creat ...
- http://chenzhou123520.iteye.com/blog/1811340
http://chenzhou123520.iteye.com/blog/1811340
- [转]http://m635674608.iteye.com/blog/1750833
转载地址:http://m635674608.iteye.com/blog/1750833 在第一次使用TortoiseSVN从服务器CheckOut的时候,会要求输入用户名和密码,这时输入框下面有个 ...
- rabbitMq 转自 http://gaoyangang.iteye.com/blog/1566600
rabbitMq 转自 http://gaoyangang.iteye.com/blog/1566600
- http://jinnianshilongnian.iteye.com/blog/1996071
http://jinnianshilongnian.iteye.com/blog/1996071 http://my.oschina.net/jkcui/blog/388400 http://tian ...
- http://jinnianshilongnian.iteye.com/blog/2018936
http://jinnianshilongnian.iteye.com/blog/2018936
- http://wsj356428476.iteye.com/blog/1655032
http://wsj356428476.iteye.com/blog/1655032 http://jingyan.baidu.com/article/19192ad83ce167e53e570705 ...
- spring mvc入门教程 转载自【http://elf8848.iteye.com/blog/875830】
目录 一.前言二.spring mvc 核心类与接口三.spring mvc 核心流程图 四.spring mvc DispatcherServlet说明 五.spring mvc 父子上下文的说明 ...
- 《C和指针(Pointer on c)》 学习笔记(转自:http://dsqiu.iteye.com/blog/1687944)
首先本文是对参考中三个连接的博客进行的整理,非常感谢三位博主的努力,每次都感叹网友的力量实在太强大了…… 第一章 快速上手 1. 在C语言中用/*和*/来注释掉这段代码,这个实际上并不是十分的安全, ...
随机推荐
- 反编译示例:mxd检查
gisoralce在博客园发布了一个mxd检查工具,主要功能是将arcgis的mxd数据源有效性(含矢量和影像)检查.检查是否为相对路径,自动保存为相对路径. 这是一个未加壳的.NET程序,正好拿来练 ...
- Java中equals和==的解析
java中的数据类型,可分为两类: 1.基本数据类型,也称原始数据类型.byte,short,char,int,long,float,double,boolean 他们之间的比较,应用双等号(== ...
- UNIX网络编程读书笔记:shutdown函数
终止网络连接的通常方法是调用close函数.不过close有两个限制,却可以使用shutdown来避免. close 把描述字的引用计数减1,仅在该计数变为0时才关闭套接口.使用shutdown可以不 ...
- Python 中的几种复制文件的用法
1. os.system Python code import os import tempfile filename1 = tempfile.mktemp (".txt") #产 ...
- error: command 'gcc' failed with exit status 1 while installing eventlet
Ubuntu安装Python包出错解决办法 : sudo apt-get install python-dev sudo apt-get install libevent-dev
- 【linux】FTP添加用户,设置权限和目录
一.目的,新建一个用户 test2,登录ftp,它只有自己的主目录权限,其他同级和上级目录没有权限 二.ftp安装.配置 yum -y install vsftpd //通过yum来安装vsftpd ...
- Yii::记录日志到自定义文件
默认情况下,Yii::log($msg, $level, $category)会把日志记录到runtime/application.log文件中 日志格式如下: [时间] - [级别] - [类别] ...
- Linux下源码安装JDK7
安装说明 安装环境:Red Hat Enterprise Linux7.1安装方式:源码安装 软件:jdk-7u80-linux-x64.gz 安装 #首先查看系统原有JDK信息 rpm -qa | ...
- 转MQTT压力测试之Tsung的使用
转自:http://www.cnblogs.com/lingyejun/p/7941271.html nTsung测试工具的基本测试命令为 Tsung -f ~/.tsung/mqtt.xml -l ...
- EMQ学习---客户链接资源消耗
Erlang进程消耗EMQ对客户端链接使用链接进程(emqtt_client)和session进程(emqtt_session)分开的策略. 当一个mqtt的客户端连接到EMQ的服务器上的时候,首先会 ...