@Configuration
Artifact
- org.springframework.context.annotation
역할
- 설정 Class를 명시하고, Bean으로 등록
- @Configuration이 적용되 Class는 Singleton 생성됨
사용법
@Configuration
@EnableWebMvc
@ComponentScan(basePackages = "org.infinity.server.controller.api")
public class MvcConfig implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new MyInterceptor());
}
}
댓글남기기