Contents
see List작성일 2022. 05. 24.
private static final List<String> URL_PATTERNS = Arrays.asList("/**"); // 인터셉터가 동작 해야 될 요청
// 주소 mapping 목록
// 인터셉터 주소 세팅
@Bean
public AuthInterceptor customInterceptor() {
return new AuthInterceptor();
}
@Autowired
private AuthInterceptor authInterceptor;
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(authInterceptor).addPathPatterns(URL_PATTERNS);
// .excludePathPatterns("/board");
}
new 로 생성을 해 의존성 주입이 되지 않아 그런다.
위처럼 @Bean 으로 등록해 주면 해결된다.
spring
| No | 작성일 | Title |
|---|---|---|
| 32 | 2014. 09. 26. | [ spring ] properties 파일 쉽게 사용하기(jsp,javs 소스) |
| 31 | 2014. 09. 25. | [ spring ] 스프링에서 aop(aspectj) 와 트랜젝션 순서 정하기 |