1. 程式人生 > >struts2 表單提交時的亂碼問題處理

struts2 表單提交時的亂碼問題處理

如果表單提交的是post方式  :

在struts2 的核心檔案struts.xml中 加入如下配置

  <struts>

   <constant name="struts.i18n.encoding" value="UTF-8" />  

</struts>


如果表單提交的是get方式:

但是如果你是用的get,就去你的tomcat目錄下的conf/server.xml中找到下面一段:


加上URIEncoding = "UTF-8"  即可