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

master
mjkhan21 1 year ago
parent f8aa2d1a88
commit 9c6861be1b

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

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

Loading…
Cancel
Save