在运用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即国际语言