/** * date created : Created in 2024/2/26 15:43 * description : TODO * class name : MyFilter */ public class MyFilter implements Filter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { // 处理过滤器的逻辑 System.out.println("MyFilter doFilter"); chain.doFilter(request, response); } }
import cn.only.hww.todo.server.filter.MyFilter; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.web.DefaultSecurityFilterChain; import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.util.matcher.AntPathRequestMatcher; import org.springframework.security.web.util.matcher.RequestMatcher; /** * date created : Created in 2024/2/26 14:25 * description : TODO 测试SecurityFilterChain * class name : MySecurityConfig */ @Configuration public class MySecurityConfig {
@Bean @Order(10) public SecurityFilterChain test1(HttpSecurity http) throws Exception {
MyFilter filter = new MyFilter();
RequestMatcher matcher = new AntPathRequestMatcher("/testMatcher");
DefaultSecurityFilterChain defaultSecurityFilterChain = new DefaultSecurityFilterChain(matcher, filter); return defaultSecurityFilterChain; }
/** * date created : Created in 2024/2/26 14:25 * description : TODO 测试SecurityFilterChain * class name : MySecurityConfig */ @Configuration public class MySecurityConfig {
@Bean @Order(10) public SecurityFilterChain test1(HttpSecurity http) throws Exception {
MyFilter filter = new MyFilter();
RequestMatcher matcher = new AntPathRequestMatcher("/testMatcher");
DefaultSecurityFilterChain defaultSecurityFilterChain = new DefaultSecurityFilterChain(matcher, filter); return defaultSecurityFilterChain; }
@Bean @Order(8) public SecurityFilterChain test2(HttpSecurity http) throws Exception {
MyFilter filter = new MyFilter();
RequestMatcher matcher = new AntPathRequestMatcher("/test222Matcher");
DefaultSecurityFilterChain defaultSecurityFilterChain = new DefaultSecurityFilterChain(matcher, filter); return defaultSecurityFilterChain; }
泳池软管检测检测系统源码分享
[一条龙教学YOLOV8标注好的数据集一键训练_70全套改进创新点发刊_Web前端展示]
1.研究背景与意义
项目参考AAAI Association for the Advancement of Artificial Intelligence
项目来源AACV Association for the Advancement of Computer Vis…