struts2中form提交到action的中文参数乱码有关问题

struts2中form提交到action的中文参数乱码问题
为了解决form提交到action中的中文参数乱码问题。
根据页面编码进行设置,如果所有页面使用UTF-8就使用UFT-8,如果GBK,就设置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.properties文件中设置struts.i18n.encoding=GBK。
3.或者在struts.xml文件内添加常量:
<constant name="struts.i18n.encoding" value="GBK"/>