JSONP与Spring 3.0和Jackson [英] JSONP with Spring 3.0 and Jackson
本文介绍了JSONP与Spring 3.0和Jackson的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用Spring 3.0返回JSON响应足以添加 @ResponseBody
注释以及 @RequestMapping
在 @Controller
中。如果加载MapppingJacksonJson库并且客户端使用 application / json
发送Accept标头,它将起作用。
To return a JSON response with Spring 3.0 is enough to add a @ResponseBody
annotation along with the @RequestMapping
inside a @Controller
. Provided that MapppingJacksonJson library is loaded and that the client sends Accept header with application/json
, it will work.
JSONP怎么样?是否可以返回它以及如何返回?
What about JSONP? Is it possible to return it and how?
推荐答案
请参阅Jeremy Grelle关于这篇博客文章。这是另一个教程。
See Jeremy Grelle's answer on this blog post. Here's another tutorial.
这篇关于JSONP与Spring 3.0和Jackson的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文