После {*...} или ** элемента шаблона больше не допускается использование данных шаблона. ⇐ JAVA
-
Гость
После {*...} или ** элемента шаблона больше не допускается использование данных шаблона.
Я перенес свою Springboot с версии 2.4 на 3.1, и это мои зависимости в файле Gradle.
реализация 'org.springframework.boot:spring-boot-starter-web:3.2.0' реализация 'org.springframework:spring-websocket:6.1.4' реализация('org.springframework.boot:spring-boot-starter-security:3.2.0') и мой файл конфигурации безопасности
@Configuration @EnableWebSecurity @EnableMethodSecurity общественный класс JwtSecurityConfig { @Autowired частный UserDetailsService userDetailsService; @Autowired частный RequestFilter requestFilter; @Autowired частный JwtEntryPoint jwtEntryPoint; @Autowired public void globalUserDetails (AuthenticationManagerBuilder auth) выдает исключение { auth.userDetailsService(userDetailsService); } @Бин общественный UserDetailsService userDetailsService () { вернуть новый UserDetailsService(); } @Бин public SecurityFilterChain filterChain(HttpSecurity httpSecurity) выдает исключение { httpSecurity.csrf(csrf -> csrf.disable()).authorizeHttpRequests(auth -> auth .requestMatchers("/student/{studentId}/**").permitAll() .requestMatchers("/{userId}/websocket/**").permitAll() .anyRequest().аутентифицированный()) .ExceptionHandling(exp -> exp.authenticationEntryPoint(jwtEntryPoint)) .sessionManagement(sess -> sess.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) .addFilterBefore(requestFilter, UsernamePasswordAuthenticationFilter.class); вернуть httpSecurity.build(); } } у меня простой контроллер,
@RestController @RequestMapping("/студент") публичный класс StudentController { @Autowired частный репозиторий StudentRepository; @GetMapping(value = "/{studentId}/get") public ResponseEntity getStudent(@PathVariable String StudentId) { вернуть reposity.findById(studentId); } } Но когда я достиг конечной точки, которую он дает, после {*...} или ** элемента шаблона больше не допускается использование данных шаблона.
Я добавил ресурс, но все еще сталкиваюсь с этой проблемой
spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER` есть ли решение этой проблемы? заранее спасибо за помощь.
Я перенес свою Springboot с версии 2.4 на 3.1, и это мои зависимости в файле Gradle.
реализация 'org.springframework.boot:spring-boot-starter-web:3.2.0' реализация 'org.springframework:spring-websocket:6.1.4' реализация('org.springframework.boot:spring-boot-starter-security:3.2.0') и мой файл конфигурации безопасности
@Configuration @EnableWebSecurity @EnableMethodSecurity общественный класс JwtSecurityConfig { @Autowired частный UserDetailsService userDetailsService; @Autowired частный RequestFilter requestFilter; @Autowired частный JwtEntryPoint jwtEntryPoint; @Autowired public void globalUserDetails (AuthenticationManagerBuilder auth) выдает исключение { auth.userDetailsService(userDetailsService); } @Бин общественный UserDetailsService userDetailsService () { вернуть новый UserDetailsService(); } @Бин public SecurityFilterChain filterChain(HttpSecurity httpSecurity) выдает исключение { httpSecurity.csrf(csrf -> csrf.disable()).authorizeHttpRequests(auth -> auth .requestMatchers("/student/{studentId}/**").permitAll() .requestMatchers("/{userId}/websocket/**").permitAll() .anyRequest().аутентифицированный()) .ExceptionHandling(exp -> exp.authenticationEntryPoint(jwtEntryPoint)) .sessionManagement(sess -> sess.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) .addFilterBefore(requestFilter, UsernamePasswordAuthenticationFilter.class); вернуть httpSecurity.build(); } } у меня простой контроллер,
@RestController @RequestMapping("/студент") публичный класс StudentController { @Autowired частный репозиторий StudentRepository; @GetMapping(value = "/{studentId}/get") public ResponseEntity getStudent(@PathVariable String StudentId) { вернуть reposity.findById(studentId); } } Но когда я достиг конечной точки, которую он дает, после {*...} или ** элемента шаблона больше не допускается использование данных шаблона.
Я добавил ресурс, но все еще сталкиваюсь с этой проблемой
spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER` есть ли решение этой проблемы? заранее спасибо за помощь.
Мобильная версия