gboat2.base.plugin.servlet.filter
类 GboatEncodingFilter

java.lang.Object
  继承者 org.springframework.web.filter.GenericFilterBean
      继承者 org.springframework.web.filter.OncePerRequestFilter
          继承者 gboat2.base.plugin.servlet.filter.GboatEncodingFilter
所有已实现的接口:
javax.servlet.Filter, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.EnvironmentAware, org.springframework.web.context.ServletContextAware

public class GboatEncodingFilter
extends org.springframework.web.filter.OncePerRequestFilter

处理请求编码的过滤器,解决 get 方式提交乱码问题。
在 web.xml 中添加如下配置启用该过滤器:


 <!-- 编码过滤器 -->
 <filter>
     <filter-name>gboat2EncodingFilter</filter-name>
     <filter-class>gboat2.base.plugin.servlet.filter.GboatEncodingFilter</filter-class>
 </filter>
 <filter-mapping>
     <filter-name>gboat2EncodingFilter</filter-name>
     <url-pattern>*.do</url-pattern>
 </filter-mapping>
 

从以下版本开始:
1.0
作者:
zhangxj-a

字段摘要
 
从类 org.springframework.web.filter.OncePerRequestFilter 继承的字段
ALREADY_FILTERED_SUFFIX
 
构造方法摘要
GboatEncodingFilter()
           
 
方法摘要
protected  void doFilterInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain filterChain)
           
 
从类 org.springframework.web.filter.OncePerRequestFilter 继承的方法
doFilter, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatch
 
从类 org.springframework.web.filter.GenericFilterBean 继承的方法
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

GboatEncodingFilter

public GboatEncodingFilter()
方法详细信息

doFilterInternal

protected void doFilterInternal(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response,
                                javax.servlet.FilterChain filterChain)
                         throws javax.servlet.ServletException,
                                IOException
指定者:
org.springframework.web.filter.OncePerRequestFilter 中的 doFilterInternal
抛出:
javax.servlet.ServletException
IOException


Copyright © 2014 广联达软件股份有限公司(Glodon Software Co., Ltd.). All rights reserved.