12
struts2中form提交到action中的中文参数乱码问题解决办法为了解决form提交到action中的中文参数乱码问题。
1.在struts2-core-2.0.0-SNAPSHOT.jar包中路径为struts2-core-2.0.6/org/apache/struts2有一个default.properties 文件,把struts.i18n.encoding=UTF-8改为struts.i18n.encoding=GBK
2.或者在struts.xml文件内添加常量:
<constant name="struts.i18n.encoding" value="GBK"/>
1.在struts2-core-2.0.0-SNAPSHOT.jar包中路径为struts2-core-2.0.6/org/apache/struts2有一个default.properties 文件,把struts.i18n.encoding=UTF-8改为struts.i18n.encoding=GBK
2.或者在struts.xml文件内添加常量:
<constant name="struts.i18n.encoding" value="GBK"/>
本文介绍了解决Struts2框架中form提交到action的中文参数出现乱码的问题。通过修改struts2-core包中的default.properties文件或在struts.xml文件中设置struts.i18n.encoding为GBK来解决。
708

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



