开发者

Spring3 MappingJacksonJsonView vs. MappingJacksonHttpMessageConverter

Spring 3 includes the ContentnegotiatingViewResolver which can be used to decide on the views based on Aceept HTTP header for example开发者_JAVA百科.

This would be one way to render a json view, another way (which also provides mapping for incoming request bodies to objects) would be to setup the MappingJacksonHttpMessageConverter.

Which one is used best? Are there any guidelines or hints?

Thanx!


MappingJacksonHttpMessageConverter looks alike a good approach , in case you want to skip the view resolution altogether.

HttpMessageConverter would allow you to do do more like XML,etcImages,etc easily and you can also unit test them :)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜