@Qualifier
-
@RequiredArgsConstructor를 사용 못하는 경우개발/Spring 2023. 12. 24. 01:13
같은 타입의 빈을 복수로 정의했을 때는 모호성 에러가 발생하는데 이 때 생성자를 직접 정의해 객체를 주입할 때 @Qualifier를 사용해서 컴포넌트를 명시한다. public SecurityConfig( CustomUserDetails customUserDetails, PasswordEncoder passwordEncoder, AuthenticationDetailsSource authenticationDetailsSource, @Qualifier("customAuthSuccessHandler") AuthenticationSuccessHandler successHandler, @Qualifier("customAuthFailureHandler") AuthenticationFailureHandler failu..