포트폴리오/SPRINGBOOT 옛날

04 : ANNOTATION

서버관리자 페페 2022. 10. 25. 16:49

 

 

@Configuration

  • 스프링의 환경설정 파일을 알려줌
  • 클래스 위에 작성
  • import org.springframework.context.annotation.Configuration;

 

-

 

 

 

@Bean

  • 메소드 위에 작성
  • import org.springframework.context.annotation.Bean;

 

-

 

 

@EnableWebSecurity

  • 모든 요청 URL이 스프링 시큐리티의 제어를 받도록 함
  • 시큐리티클래스 위에 작성
  • 내부적으로 SpringSecurityFilterChain이 동작하여 URL을 필터링함
  • import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;

 

-

 

@Bean

public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { }

  • import org.springframework.security.web.SecurityFilterChain;
  • import org.springframework.config.annotation.web.builders.HttpSecurity;

 

-

 

@Bean

 

'포트폴리오 > SPRINGBOOT 옛날' 카테고리의 다른 글

06 : 생성자  (0) 2022.10.25
05 : Handling Exception  (0) 2022.10.25
3-14 : 검색  (0) 2022.10.14
3-13 : 마크다운  (0) 2022.10.13
3-12 : 앵커  (0) 2022.10.13