Springmvc息转换器

当使用了 配置等同于@EnableWebMvc注解的时候就默认启用了响应消息转换器

1.原始字符串转换器:org.springframework.http.converter.StringHttpMessageConverter 
    输出 text/plan 原始字符串 
     默认ISO-8859-1编码  

2.文件下载流转换器:org.springframework.http.converter.ByteArrayHttpMessageConverter
   主要用于下载文件,输入文件流
   ContentType:application/octet-stream

3.资源转换器:org.springframework.http.converter.ResourceHttpMessageConverter
  默认读取所有类型的文件,如果可用的话将 ContentType:application/octet-stream 方式输出

4.表单数据转换器:org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter
  主要用于读取 Form表单


5.xml转换读取器:org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter
  主要是处理xml数据  Content-type:application/*+xml

6.json转换器:org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
  主要是处理json数据 Content-Type:application/json

可以在 中在加以明细配置
 


        
            
            
                
            
            
            
        


    

 

 

你可能感兴趣的:(javaweb,springMVC,springmvc)