코딩/자바
스프링부트 알림창 인터셉터로 처리하기
비전공개발자
2020. 7. 12. 17:52
1. Webconfig
WebConfig.java
public class WebConfig implements WebMvcConfigurer {
@Ovveride
public void addInterceptors() {
List<String> staticResourcesPath = Arrays.stream(StaticResourceLocation.values())
// 기존 패턴 형식에 맞춰주기 위해 값 커스텀 세팅
.flatMap(StaticResourceLocation::getPatterns)
.collect(Collectors.toList());
staticResourcesPath.add("/node_modules/**");
registry.addInterceptor(notificationInterceptor).excludePathPatterns(staticResourcesPath);
}
}