spring-web工程中的編碼設置

<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="webBindingInitializer"><!-- 日期綁定 -->
<bean class="com.qlk.cloud.baymax.common.utils.BindingInitializer" />
<!-- <bean class="org.springframework.web.bind.support.ConfigurableWebBindingInitializer">
<property name="conversionService">
<bean class="org.springframework.format.support.FormattingConversionServiceFactoryBean"></bean>
</property>
</bean> -->
</property>
<property name="messageConverters">
<list>
<bean class = "org.springframework.http.converter.StringHttpMessageConverter">
<constructor-arg value="UTF-8" />
<property name="supportedMediaTypes">
<list>
<value>text/plain;charset=UTF-8</value>
<value>application/json;charset=UTF-8</value>
</list>
</property>
</bean>
<ref bean="mappingJacksonHttpMessageConverter"/>
</list>
</property>
</bean>web

相關文章
相關標籤/搜索