SpringMVC 直接返回中文字符串时,出现乱码(?)的问题
2024-10-18 18:56:04
在springmvc.xml中加入下面配置得以解决。
<mvc:annotation-driven>
<mvc:message-converters>
<bean class="org.springframework.http.converter.StringHttpMessageConverter">
<constructor-arg ref="utf8Charset"></constructor-arg>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
<bean id="utf8Charset" class="java.nio.charset.Charset" factory-method="forName">
<constructor-arg value="UTF-8"/>
</bean>
最新文章
- C++11之std::function和std::bind
- js通过日期计算属于星期几
- WSGI
- SQL Server In-Memory OLTP 无损PPT分享
- jQuery插件之jquery editable plugin--点击编辑文字插件
- Investment_完全背包
- C++:构造函数默认的参数声明
- angular select中ng-options使用
- Oracle数据库名、实例名、数据库域名、全局数据库名、服务名之间的区别
- JSP中取COOKIE中指定值得方法【转载】
- 大型分布式C++框架《三:序列化与反序列化》
- 关于Opencv2.4.x中stitcher类的简单应用
- 超赞的OOM检测(除了mat以外)
- Duplicate entry &#39;0&#39; for key &#39;PRIMARY&#39;的一种可能的解决办法
- windows 10隐藏各种文件夹
- PHP选择排序
- nodeJs 控制台打印中文显示为Unicode解决方案
- bootstrap-table 分页
- MVC5+EF6入门教程——实现动态创建数据库与登录验证
- js中怎么为同级元素添加点击事件