默认起用的MVC注解功能
ByteArrayMessageConverter:that can read and write byte arrays from the HTTP request and response.
MarshallingHttpMessageConverter:XML的转换需要使用Spring的
MappingJacksonHttpMessageConverter:JSON的转换.
SourceHttpMessageConverter:能够读/写来自HTTP的请求与响应的javax.xml.transform.Source
BufferedImageHttpMessageConverter:that can read and write
起用JSON转换功能
MappingJacksonHttpMessageConverter能够将POJO对象自动转换为JSON对象
需要依赖JSON对象的处理JAR包
jackson-core-lgpl.jar
jackson-mapper-lgpl.jar
下载地址:
http://jackson.codehaus/
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
StringHttpMessageConverter: that can read and write Strings from the HTTP request and response.
FormHttpMessageConverter:that can read and write form data from the HTTP request and response.
ByteArrayMessageConverter:that can read and write byte arrays from the HTTP request and response.
MarshallingHttpMessageConverter:XML的转换需要使用Spring的 Marshaller
和 Unmarshaller.
MappingJacksonHttpMessageConverter:JSON的转换.
SourceHttpMessageConverter:能够读/写来自HTTP的请求与响应的javax.xml.transform.Source ,支持
DOMSource
, SAXSource
, 和 StreamSource
的XML格式
BufferedImageHttpMessageConverter:that can read and write java.awt.image.BufferedImage
from the HTTP request and response
起用JSON转换功能
MappingJacksonHttpMessageConverter能够将POJO对象自动转换为JSON对象
需要依赖JSON对象的处理JAR包
jackson-core-lgpl.jar
jackson-mapper-lgpl.jar
下载地址:
http://jackson.codehaus/
转载地址:http://www.blogjava/wmcoo/articles/333472.html
更多推荐
Spring MVC的自动转换功能 HttpMessageConverter
发布评论