过滤器的建立

过滤器的基本结构:

package....;

import....;

public classFilter implements Filter{//这里是给出Filter的一个实现类Filter1

  public void destroy(){

    //添加代码

  }

public void doFilter(ServletRequest request,ServletResponse response,

  FilterChain filterChain)throws IOException,ServletException{

  //添加代码

}

public void init(FilterConfig filterConfig)throws ServletException{

  //添加代码

}

}

posted @ 2017-11-05 22:18  随心佩  阅读(150)  评论(0编辑  收藏  举报