I want to add reques开发者_开发技巧t mapping my controller which gets a Json of Array of an object. The JSON will be sent from javascript using post.
Thanks, Kfir
You can do this using Spring's @RequestBody
annotation, e.g.
@ResponseBody
public Map<String, Object> handleJsonPost(@RequestBody Map<String, Object> requestJson) {
...
return responseJson;
}
This will also send the return value back as JSON.
You'll also need to include the Jackson library in your application's classpath, and add
<mvc:annotation-driven/>
to your context (see docs)
精彩评论