Spring mvc @ResponseBody jquery ajax调用出现如下错误:406 Not Acceptable
2012-07-04 02:11
344 查看
jQuery.ajax({ type: "POST", url: "ajax/ajaxCheckLoginName.do", data: "username="+$("#name").val(), error: function(XMLHttpRequest, error, errorThrown){ alert(error); alert(errorThrown); }, success: function(response){ if(response==1){ $("#name").removeClass("extra");} } });
controller执行正常,jquery.ajax始终无法执行回调函数
加入错误查看代码:
error: function(XMLHttpRequest, error, errorThrown){ alert(error); alert(errorThrown); },
提示: Not Acceptable
The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers ().
需要加入jackson依赖:
<dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-core-asl</artifactId> <version>1.8.5</version> </dependency> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-mapper-asl</artifactId> <version>1.8.5</version> </dependency>
相关文章推荐
- Spring mvc @ResponseBody jquery ajax调用出现如下错误:406 Not Acceptable
- 用ADO调用存储过程时出现如下错误时如何解决?
- SpringMVC 利用@ResponseBody注解返回Json时,出现406 not acceptable 错误的解决方法。
- 将aspx重写成.html后缀的伪静态地址后,如果后台需要调用Session,可能会出现如下错误:
- springMvc中406错误解决,springMvc使用json出现406 (Not Acceptable)
- spring mvc json @ResponseBody 出现406错误 not acceptable ,解决方法,亲测可行
- adb连接时出现如下错误CreateProcess failure, error 2 * could not start server *
- 出现错误如下:AttributeError: 'module' object has no attribute 'SSL_ST_INIT'
- masm winasm 出现如下错误
- spring mvc 出现406错误
- PB编译出现如下错误:BLDDEMO: There were errors building K390
- fckeditor出现调用的对象无效JS错误
- Dbvisualizer 打开过程中出现如下错误
- VC6调用VC2005编译生成的lib/dll库出现“unresolved external symbol "__declspec(dllimport) int __cdecl”错误的原因
- ajax调用出现undefined错误
- Opencv中调用FileStorage出现错误“Stack around the variable '*' was corrupted.”
- Ubuntu 安装软件出现如下错误:无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。
- 调用C#写的Web服务, 怎么老是出现错误
- spring后台返回json数据 页面406错误 Not Acceptable解决
- https调用出现【基础连接已经关闭: 未能为 SSL/TLS 安全通道建立信任关系】错误