自定义Filter
- 启动类里面增加 @ServletComponentScan,进行扫描
- 新建一个MyFilter类,implements Filter,并实现对应的接口
- @WebFilter 标记一个类为filter,被spring进行扫描,urlPatterns:拦截规则,支持正则
- 控制chain.doFilter的方法的调用,来实现是否通过放行不放行,web应用resp.sendRedirect("/index.html");
springboot(9)_过滤器
原文:https://www.cnblogs.com/xeclass/p/12639520.html