Spring velocity 中文乱码 解决方案
来源:互联网 发布:笨办法学python下载 编辑:程序博客网 时间:2024/06/11 06:12
主要有这么几步,在spring web 的 [sevlet-name]-servlet.xml文件中,修改为:
蓝色字体为关键,其它根据你的实际情况配置:
<!-- ========================= VIEW DEFINITIONS ========================= -->
<bean id="velocityViewResolver" class="org.springframework.web.servlet.view.velocity.VelocityViewResolver">
<property name="suffix" value=".vm"></property>
<property name="contentType"><value>text/html;charset=UTF-8</value></property>
</bean>
<bean id="velocityConfigurer" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
<property name="resourceLoaderPath">
<value>${pgallery.template}</value>
</property>
<property name="velocityProperties">
<props>
<prop key="input.encoding">utf-8</prop>
<prop key="output.encoding">utf-8</prop>
</props>
</property>
</bean>
注:
首先要保证开发环境的文件编码统一,将jsp/html的字符编码都声明为utf-8。
- Spring velocity 中文乱码 解决方案
- velocity中文乱码最终解决方案
- velocity中文乱码最终解决方案
- velocity中文乱码最终解决方案
- velocity中文乱码最终解决方案
- FreeMarker + Spring中文乱码解决方案
- Spring Boot 中文乱码解决方案
- Velocity中文乱码解决
- spring下使用velocity的中文乱码问题
- 使用spring发送Mail + Velocity 模板 - 中文乱码解决
- Spring MVC POST中文乱码解决方案
- Spring MVC POST中文乱码解决方案
- Spring MVC POST中文乱码解决方案
- Spring MVC POST中文乱码解决方案
- Spring MVC POST中文乱码解决方案
- Spring MVC @ResponseBody 中文乱码 解决方案
- Spring MVC POST中文乱码解决方案
- Spring MVC POST中文乱码解决方案
- 在Delphi感知控件中显示"(VARBYTES)"的解决办法
- 《中国科技博览》杂志 征稿启示
- 研究发现 Twitter 用户忠诚度只有40%
- 怎样理解DC(device context) 这个词
- 告一段落
- Spring velocity 中文乱码 解决方案
- CSDN 我来了!
- 左右移动进行选取
- SQL Server 版本变更检查 警告
- 记录北京吃路历程
- 上拉、下拉电阻的作用
- 二分图最大匹配 匈牙利算法 (自己写的模板)
- 寻
- final ,static 之区别