From 9c6861be1b12d282e9ccc75dbdcd6222bfb8ea53 Mon Sep 17 00:00:00 2001 From: mjkhan21 Date: Mon, 12 Jun 2023 16:01:18 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A0=95=EC=A0=81=20=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EC=84=9C=EB=B9=84=EC=8A=A4=20=EA=B2=BD=EB=A1=9C=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20-=20/files/**?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/cokr/xit/foundation/boot/MvcConfig.java | 4 ++-- src/main/java/cokr/xit/foundation/boot/ServletConfig.java | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/cokr/xit/foundation/boot/MvcConfig.java b/src/main/java/cokr/xit/foundation/boot/MvcConfig.java index b502785..ec3aede 100644 --- a/src/main/java/cokr/xit/foundation/boot/MvcConfig.java +++ b/src/main/java/cokr/xit/foundation/boot/MvcConfig.java @@ -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로 추가한다. diff --git a/src/main/java/cokr/xit/foundation/boot/ServletConfig.java b/src/main/java/cokr/xit/foundation/boot/ServletConfig.java index 8d87667..4ea9d4d 100644 --- a/src/main/java/cokr/xit/foundation/boot/ServletConfig.java +++ b/src/main/java/cokr/xit/foundation/boot/ServletConfig.java @@ -47,7 +47,11 @@ public class ServletConfig { */ @Bean public ServletRegistrationBean defaultServlet() { - ServletRegistrationBean bean = new ServletRegistrationBean<>(new DefaultServlet(), "/resources/*"); + ServletRegistrationBean bean = new ServletRegistrationBean<>( + new DefaultServlet(), + "/resources/*", + "/files/*" + ); bean.setLoadOnStartup(1); HashMap params = new HashMap<>();