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

来源:互联网 发布:java分母最小化 编辑:程序博客网 时间:2024/05/24 15:38

  在运用Struts2时我们会经常遇到乱码问题。对于Struts2中的乱码问题一般有俩中解决办法第一种:

             在核心包的org\apache\atruts2的路径下有一个default.properties文件,将其中的struts.i18n.encoding=UTF-8的UTF-8改为GBK

第二种:

         在struts.xml配置中添加常量:

 <constant name="struts.i18n.encoding" value="GBK"/>

i18n=internationalization即国际语言

1 0
原创粉丝点击