Sak*_*ain 5 java warnings spring-security spring-boot
我目前正在使用 Spring boot 更新版本 3.2.0 并在运行应用程序后实现了SecurityFilterChain我收到此消息:
2023-12-11T12:08:04.541+06:00 WARN 28000 --- [nio-8080-exec-1] o.s.w.s.h.HandlerMappingIntrospector : Cache miss for REQUEST dispatch to '/' (previous null). Performing CorsConfiguration lookup. This is logged once only at WARN level, and every time at TRACE.
2023-12-11T12:08:04.550+06:00 WARN 28000 --- [nio-8080-exec-1] o.s.w.s.h.HandlerMappingIntrospector : Cache miss for REQUEST dispatch to '/' (previous null). Performing MatchableHandlerMapping lookup. This is logged once only at WARN level, and every time at TRACE.
Run Code Online (Sandbox Code Playgroud)
SecurityFilterChain的代码:
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
http
.authorizeHttpRequests((requests) -> requests
.requestMatchers("/", "/Signup", "/css/**", "/js/**").permitAll()
.anyRequest().authenticated()
)
.formLogin((form) -> form
.loginPage("/Login")
.permitAll()
)
.logout((logout) -> logout.permitAll())
.formLogin((form) -> form.defaultSuccessUrl("/home", true));
return http.build();
}
Run Code Online (Sandbox Code Playgroud)
知道我为什么收到这条消息吗?当我点击localhost:8080自动进入登录页面时,它很好,但当我单击注册按钮时,不会进入注册页面,它只会重定向到登录页面。您能否提供详细的工作流程以及解决问题的方法。
先感谢您。
我刚刚在升级项目的 Spring Boot 版本时遇到了这个警告。
这是Spring Boot 3.2.0 的当前问题。应该用这张票来解决。
同时我们可以将日志级别更改为错误:
logging.level.org.springframework.web.servlet.handler.HandlerMappingIntrospector=ERROR
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9170 次 |
| 最近记录: |