gboat2.base.plugin.servlet.filter
类 GboatUserSessionFilter

java.lang.Object
  继承者 gboat2.base.plugin.servlet.filter.GboatUserSessionFilter
所有已实现的接口:
javax.servlet.Filter

public class GboatUserSessionFilter
extends Object
implements javax.servlet.Filter

用户过滤器,检查用户是否登录
支持参数 excludes:设置忽略检查的路径,多个路径以“,”或“;”分隔,路径支持“*”匹配任意字符。 在 web.xml 中添加如下配置:


 <filter> 
    <filter-name>userfilter</filter-name>
    <filter-class>gboat2.base.filter.Gboat2UserSessionFilter</filter-class> 
    <init-param>
        <param-name>excludes</param-name>
        <param-value> 
            /index.do; 
            /login*.do
        </param-value>
    </init-param>
    <init-param>
        <param-name>default-index-page</param-name>
        <param-value> 
            /index.do 或者 index.do (用户没有登录时,直接跳转到该路径)
        </param-value>
    </init-param>
 </filter>
 

从以下版本开始:
1.0
作者:
zhaop

构造方法摘要
GboatUserSessionFilter()
           
 
方法摘要
 boolean checkExecludesUri(String uri)
           
 void destroy()
           
 void doFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, javax.servlet.FilterChain chain)
           
 void init(javax.servlet.FilterConfig config)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

GboatUserSessionFilter

public GboatUserSessionFilter()
方法详细信息

init

public void init(javax.servlet.FilterConfig config)
          throws javax.servlet.ServletException
指定者:
接口 javax.servlet.Filter 中的 init
抛出:
javax.servlet.ServletException

doFilter

public void doFilter(javax.servlet.ServletRequest req,
                     javax.servlet.ServletResponse res,
                     javax.servlet.FilterChain chain)
              throws IOException,
                     javax.servlet.ServletException
指定者:
接口 javax.servlet.Filter 中的 doFilter
抛出:
IOException
javax.servlet.ServletException

checkExecludesUri

public boolean checkExecludesUri(String uri)

destroy

public void destroy()
指定者:
接口 javax.servlet.Filter 中的 destroy


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