From 4dbc9384aea7235a0fcea7a68787e33902186f36 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Fri, 15 Sep 2023 09:04:52 +0900 Subject: [PATCH] =?UTF-8?q?=ED=86=B0=EC=BA=A3=20=EC=84=A4=EC=A0=95(jsp?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EB=A1=9C=EB=93=9C=20)=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/base/boot/XitBaseApplication2.java | 26 +++++++++++++++++++ .../java/cokr/xit/fims/FimsApplication.java | 4 +-- .../xit/foundation/boot/TomcatConfig.java | 21 +++++++++++++++ 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 src/main/java/cokr/xit/base/boot/XitBaseApplication2.java create mode 100644 src/main/java/cokr/xit/foundation/boot/TomcatConfig.java diff --git a/src/main/java/cokr/xit/base/boot/XitBaseApplication2.java b/src/main/java/cokr/xit/base/boot/XitBaseApplication2.java new file mode 100644 index 00000000..089584c8 --- /dev/null +++ b/src/main/java/cokr/xit/base/boot/XitBaseApplication2.java @@ -0,0 +1,26 @@ +package cokr.xit.base.boot; + +import org.springframework.boot.autoconfigure.ImportAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.test.context.ContextConfiguration; + +import cokr.xit.foundation.boot.CommonConfig; +import cokr.xit.foundation.boot.DatasourceConfig; +import cokr.xit.foundation.boot.ServletConfig; +import cokr.xit.foundation.boot.TomcatConfig; +import cokr.xit.foundation.boot.TransactionConfig; + +@SpringBootApplication +@ImportAutoConfiguration({ + CommonConfig.class, + ServletConfig.class, + MvcConfig2.class, + DatasourceConfig.class, + TransactionConfig.class, + SecurityConfig.class, + TomcatConfig.class +}) +@ContextConfiguration("classpath:spring/context-*.xml") +public class XitBaseApplication2 { + +} diff --git a/src/main/java/cokr/xit/fims/FimsApplication.java b/src/main/java/cokr/xit/fims/FimsApplication.java index fbfb3a30..05425a7e 100644 --- a/src/main/java/cokr/xit/fims/FimsApplication.java +++ b/src/main/java/cokr/xit/fims/FimsApplication.java @@ -3,10 +3,10 @@ package cokr.xit.fims; import org.springframework.boot.SpringApplication; import org.springframework.context.annotation.ImportResource; -import cokr.xit.base.boot.XitBaseApplication; +import cokr.xit.base.boot.XitBaseApplication2; @ImportResource("classpath:spring/context-*.xml") -public class FimsApplication extends XitBaseApplication { +public class FimsApplication extends XitBaseApplication2 { public static void main(String[] args) { SpringApplication.run(FimsApplication.class, args); diff --git a/src/main/java/cokr/xit/foundation/boot/TomcatConfig.java b/src/main/java/cokr/xit/foundation/boot/TomcatConfig.java new file mode 100644 index 00000000..160d62f3 --- /dev/null +++ b/src/main/java/cokr/xit/foundation/boot/TomcatConfig.java @@ -0,0 +1,21 @@ +package cokr.xit.foundation.boot; + +import org.apache.catalina.Context; +import org.apache.catalina.webresources.ExtractingRoot; +import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.web.server.WebServerFactoryCustomizer; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class TomcatConfig { + @Bean + public WebServerFactoryCustomizer servletContainerCustomizer() { + return (TomcatServletWebServerFactory container) -> { + container.addContextCustomizers((Context context) -> { + context.setResources(new ExtractingRoot()); + context.setReloadable(false); + }); + }; + } +}