CustomServletConfig
페이지 정보
본문
package web.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
@EnableWebMvc
public class CustomServletConfig implements WebMvcConfigurer {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/js/**")
.addResourceLocations("classpath:/static/js/");
registry.addResourceHandler("/img/**")
.addResourceLocations("classpath:/static/img/");
registry.addResourceHandler("/css/**")
.addResourceLocations("classpath:/static/css/");
registry.addResourceHandler("/assets/**")
.addResourceLocations("classpath:/static/assets/");
registry.addResourceHandler("/fonts/**")
.addResourceLocations("classpath:/static/fonts/");
registry.addResourceHandler("/upload/**")
.addResourceLocations("classpath:/static/upload/");
}
}
- 이전글application.properties 24.06.25
- 다음글UploadFileDTO 24.06.25
댓글목록
등록된 댓글이 없습니다.