|
在 SpringMVC-Servlet.xml 中原有这一行 :
<bean
class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />
改为 : (加上编码指定,如不这样设置,默认输出的是 text/plain;charset=ISO... ,所以导致乱码 )
<!-- 2010-09-04,加上编码处理 -->
<bean
class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" >
<property name="messageConverters">
<list>
<bean class = "org.springframework.http.converter.StringHttpMessageConverter">
<property name = "supportedMediaTypes">
<list>
<value>text/plain;charset=UTF-8</value>
</list>
</property>
</bean>
</list>
</property>
</bean> |
|