开发者

HttpServletResponse XML to Java

I am maintaining this servlet that has a HttpServletResponse response that replies back to the client an XML message. I want to take the XML message and convert it to JSON, 开发者_Go百科then send the JSON back.

I want to avoid writing my own JSON converter if possible. Does anyone have a good method of doing this? I googled for this: http://pvoss.wordpress.com/2009/02/26/servlet-filter-to-convert-xml-to-json/ , which is exactly what I want but they are using a hacked dom4j jar which doesn't help me.


Possibly use Json-lib to roll your own filter?

Check out the snippets for inspiration, and see the Javadoc section on XMLSerializer?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜