WebConfigurations.java 1.1 KB

12345678910111213141516171819202122232425262728
  1. package com.lemon.lifecenter.common;
  2. import org.springframework.beans.factory.annotation.Autowired;
  3. import org.springframework.context.annotation.Configuration;
  4. import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
  5. import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
  6. import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
  7. @Configuration
  8. public class WebConfigurations implements WebMvcConfigurer {
  9. @Autowired
  10. LifeCenterInterCeptor lifeCenterInterCeptor;
  11. @Override
  12. public void addResourceHandlers(ResourceHandlerRegistry registry) {
  13. registry.addResourceHandler("/resources/**").addResourceLocations("/resources/");
  14. }
  15. /*
  16. * Interceptor 설정
  17. * */
  18. @Override
  19. public void addInterceptors(InterceptorRegistry registry) {
  20. registry.addInterceptor(lifeCenterInterCeptor)
  21. .addPathPatterns( "/**/*" )
  22. .excludePathPatterns( "/resources/css/**", "/resources/download/**", "/resources/js/**", "/resources/images/**", "/resources/fonts/**" );
  23. }
  24. }