Метод antMatchers() не определен для типа AuthorizeHttpRequestsConfigurer.AuthorizedUrlJAVA

Программисты JAVA общаются здесь
Ответить Пред. темаСлед. тема
Anonymous
 Метод antMatchers() не определен для типа AuthorizeHttpRequestsConfigurer.AuthorizedUrl

Сообщение Anonymous »

package com.nikola.security;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.web.SecurityFilterChain;

@Configuration //klasata mora da bide anotirana so @Configuration bidejki e configuration klasa
@EnableWebSecurity //so anotiranje na @EnableWebSecurity kazuvame deka vo ovaa klasa ke implementirame se
//za security za nasata aplikacija
public class ApplicationSecurityConfig {

@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {

http
.authorizeHttpRequests()//authoriziraj gi
.antMatchers("/","index","/css/*","/js/*")
.permitAll()
.anyRequest()//sekoj request
.authenticated()//mora da bide avtenticiran
.and()//i
.httpBasic();//mehanizmot koi sakame da go koristime e http Basic
return http.build();
}
}


Я пытаюсь посмотреть это видео: .
Но у меня возникла ошибка:Description Resource Path Location Type
The method antMatchers(String, String, String, String) is undefined for the type AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry ApplicationSecurityConfig.java /Spring-Boot-Security-Tutorial-NovoVideo/src/main/java/com/nikola/security line 19 Java Problem


Подробнее здесь: https://stackoverflow.com/questions/754 ... tsconfigur
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «JAVA»