CSDN博客

img jlcool

通过spring去除页面提交到action是乱码的问题

发表于2008/9/28 2:37:00  297人阅读

 在web.xml中添加以过滤器

  1. <filter>
  2.         <filter-name>SetCharacterEncoding</filter-name>
  3.         <filter-class>
  4.             org.springframework.web.filter.CharacterEncodingFilter
  5.         </filter-class>
  6.         <init-param>
  7.             <param-name>encoding</param-name>
  8.             <param-value>GBK</param-value>
  9.         </init-param>
  10.     </filter>
  11.     <!-- 要过滤得类型 -->
  12.     <filter-mapping>
  13.         <filter-name>SetCharacterEncoding</filter-name>
  14.         <url-pattern>*.jsp</url-pattern>
  15.     </filter-mapping>
  16.     <filter-mapping>
  17.         <filter-name>SetCharacterEncoding</filter-name>
  18.         <url-pattern>*.do</url-pattern>
  19.     </filter-mapping>
0 0

相关博文

我的热门文章

img
取 消
img