解决sruts2..6中文问题

在xml文件中配置一个filter就可以了

    <filter>
         <filter-name>encodingfilter</filter-name>
         <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
         <init-param>
            <param-name>encoding</param-name>
            <param-value>gb2312</param-value>          
         </init-param>
    </filter>
        <filter-mapping>
             <filter-name>encodingfilter</filter-name>
             <url-pattern>/*</url-pattern>
        </filter-mapping>

 

需要写在struts的filter前面

你可能感兴趣的:(xml,Web,struts)