정적 파일 서비스 경로 추가 - /files/**

master
mjkhan21 1 year ago
parent f8aa2d1a88
commit 9c6861be1b

@ -39,8 +39,8 @@ public class MvcConfig implements WebMvcConfigurer {
@Override @Override
public void addResourceHandlers(ResourceHandlerRegistry registry) { public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry registry
.addResourceHandler("/resources/**") .addResourceHandler("/resources/**", "/files/**")
.addResourceLocations("/resources/"); .addResourceLocations("/resources/", "/files/");
} }
/**AccessInitializer interceptor . /**AccessInitializer interceptor .

@ -47,7 +47,11 @@ public class ServletConfig {
*/ */
@Bean @Bean
public ServletRegistrationBean<DefaultServlet> defaultServlet() { public ServletRegistrationBean<DefaultServlet> defaultServlet() {
ServletRegistrationBean<DefaultServlet> bean = new ServletRegistrationBean<>(new DefaultServlet(), "/resources/*"); ServletRegistrationBean<DefaultServlet> bean = new ServletRegistrationBean<>(
new DefaultServlet(),
"/resources/*",
"/files/*"
);
bean.setLoadOnStartup(1); bean.setLoadOnStartup(1);
HashMap<String, String> params = new HashMap<>(); HashMap<String, String> params = new HashMap<>();

Loading…
Cancel
Save