开发者

How to retrieve a JSON object from HttpServletResponse in Spring?

I have a Spring controller in which I have to read a JSON object from a URLConnection. Currently I am doing this by reading from the conn开发者_Python百科ection's input stream line by line. Basically I am reading the text contents of the response line by line.

Is there any JSON api that I could use to populate the JSON object directly from the URLConnection? Anything that integrates with Spring?


Perhaps this is related? Essentially, implementing JsonView.


http://jackson.codehaus.org/1.6.0/javadoc/org/codehaus/jackson/JsonFactory.html#createJsonParser(java.io.InputStream) This could help, as URLConnection can return InputStream. What do you want to integrate with Spring, btw?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜