01_10_Struts2_2.1.6版本的中文问题

01_10_Struts2_2.1.6版本的中文问题

1. 由于Struts2_2.1.6存在bug

正常情况下在struts.xml配置如下一行

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

可以解决jsp提交中文乱码问题,高版本,暂时未测试

2. 处理方法调整Struts2_2.1.6的过滤类

调整web.xml文件

       <!--  <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> -->

调整为

<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class> 

同时struts.xml

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

因为默认为UTF-8所以,此列可以省略

posted @ 2018-03-27 15:19  FlyBack  阅读(88)  评论(0编辑  收藏  举报