使用:velocity,struts2.0.11
在velocity.properties文件中设置:
default.contentType=text/html
input.encoding=GBK
output.encoding=GBK
结果vm文件中还是,显示乱码。
我在struts2.properties中加上:struts.i18n.encoding=gb2312
这样浏览器正常.一切ok。
本文介绍了解决Struts2与Velocity模板引擎在页面显示乱码的问题。通过配置velocity.properties文件,并在struts2.properties中加入struts.i18n.encoding参数,最终实现了页面正常显示。
使用:velocity,struts2.0.11
在velocity.properties文件中设置:
default.contentType=text/html
input.encoding=GBK
output.encoding=GBK
结果vm文件中还是,显示乱码。
我在struts2.properties中加上:struts.i18n.encoding=gb2312
这样浏览器正常.一切ok。

被折叠的 条评论
为什么被折叠?