@WebFilter("/*")
public class File implements Filter {
public void init(FilterConfig filterConfig) throws ServletException {
System.out.println("初始化过滤器");
}
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
System.out.println("执行过滤器");
// TODO
filterChain.doFilter(servletRequest,servletResponse);(必写,不写的话有可能会报错)
}
public void destroy() {
System.out.println("销毁过滤器");
}
}
标签:void,System,println,过滤器,public,out From: https://www.cnblogs.com/yz157/p/18059397