Filter详解
1.快速入门
package com.cj.filter; import javax.servlet.*; import javax.servlet.annotation.WebFilter; import javax.servlet.annotation.WebServlet; import java.io.IOException; @WebFilter("/*") public class FilterDemo implements Filter { @Override public void init(FilterConfig filterConfig) throws ServletException { } @Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { System.out.println("1.filter"); filterChain.doFilter(servletRequest,servletResponse); System.out.println("3.filter"); } @Override public void destroy() { } }
标签:javaweb,void,javax,Filter,详解,Override,import,public From: https://www.cnblogs.com/cciscc/p/16586766.html