解决问题参考两个地址:
[url]http://blog.csdn.net/bettyly/article/details/7095740[/url]
[url]http://liyanjie918.blog.163.com/blog/static/2022729020156894259240/[/url]
前台:
上面不解决问题情况下继续下面:
加入包:
controller:
[url]http://blog.csdn.net/bettyly/article/details/7095740[/url]
[url]http://liyanjie918.blog.163.com/blog/static/2022729020156894259240/[/url]
前台:
$.ajax({
type: "POST",
contentType:"application/json", //加入这个
url: "rest/approval/checkData",
data: JSON.stringify(ds), //要变成字符串
success: function(result){
alert( "Data Saved: " + result.msg );
}
});
上面不解决问题情况下继续下面:
加入包:
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.6.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.6.3</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.13</version>
</dependency>
controller:
@RequestMapping(value = "/searchGrid.do", method= RequestMethod.POST, headers="Accept=application/json")