import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
		public abstract class HttpFilter implements Filter
{
    private FilterConfig config;
    
    //////////////////////////////////
    public void init(FilterConfig config) throws ServletException
    {
        this.config = config;
        init();
    }
    
    public void init() throws ServletException
    {
    }
    ///////////////////////////////
    public FilterConfig getFilterConfig()
    {
        return config;
    }
    
    public String getInitParameter(String name)
    {
        return config.getInitParameter(name);
    }
    
    public ServletContext getServletContext()
    {
        return config.getServletContext();
    }
    
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
                                                throws IOException, ServletException
    {
        doFilter((HttpServletRequest)request, (HttpServletResponse)response, chain);
    }
    
    public abstract void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
                                                throws IOException, ServletException;
    
    public void destroy()
    {
    }
}
	posted on 2007-04-06 16:31 
sunny 阅读(315) 
评论(0)  编辑  收藏