From d1f4b2112aab634eb8e997ac9e0236716e3c9a68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=84=9D=20=EC=B5=9C?= Date: Mon, 10 Apr 2023 10:03:14 +0900 Subject: [PATCH] =?UTF-8?q?whitelabel=20=EC=97=90=EB=9F=AC=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EB=A6=AC=EB=8B=A4=EC=9D=B4=EB=A0=89?= =?UTF-8?q?=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../faisp/config/CustomErrorController.java | 19 +++++++++++++++++++ src/main/resources/application-dev.properties | 2 ++ .../resources/application-test1.properties | 4 ++++ .../resources/application-test2.properties | 4 ++++ .../resources/application-was1.properties | 4 ++++ .../resources/application-was2.properties | 4 ++++ 6 files changed, 37 insertions(+) create mode 100644 src/main/java/com/dbnt/faisp/config/CustomErrorController.java diff --git a/src/main/java/com/dbnt/faisp/config/CustomErrorController.java b/src/main/java/com/dbnt/faisp/config/CustomErrorController.java new file mode 100644 index 00000000..fcc68f3d --- /dev/null +++ b/src/main/java/com/dbnt/faisp/config/CustomErrorController.java @@ -0,0 +1,19 @@ +package com.dbnt.faisp.config; + +import lombok.RequiredArgsConstructor; +import org.springframework.boot.web.servlet.error.ErrorController; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.ModelAndView; + + +@RestController +@RequiredArgsConstructor +public class CustomErrorController implements ErrorController { + + @GetMapping("/errors") + public ModelAndView errorsToRedirectRoot() { + return new ModelAndView("redirect:/"); + } + +} diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index ad6b9523..6ba53c5f 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -1,4 +1,6 @@ spring.devtools.livereload.enabled=true +server.error.whitelabel.enabled=false +server.error.path=/errors tomcat.ajp.protocol=HTTP/1.1 tomcat.cluster.enabled=false diff --git a/src/main/resources/application-test1.properties b/src/main/resources/application-test1.properties index 83fcd93b..2ab61b1d 100644 --- a/src/main/resources/application-test1.properties +++ b/src/main/resources/application-test1.properties @@ -1,3 +1,7 @@ + +server.error.whitelabel.enabled=false +server.error.path=/errors + #tomcat tomcat.ajp.protocol=HTTP/1.1 #tomcat.ajp.protocol=AJP/1.3 diff --git a/src/main/resources/application-test2.properties b/src/main/resources/application-test2.properties index 8c890b00..1c1ecc4a 100644 --- a/src/main/resources/application-test2.properties +++ b/src/main/resources/application-test2.properties @@ -1,3 +1,7 @@ + +server.error.whitelabel.enabled=false +server.error.path=/errors + #tomcat tomcat.ajp.protocol=HTTP/1.1 #tomcat.ajp.protocol=AJP/1.3 diff --git a/src/main/resources/application-was1.properties b/src/main/resources/application-was1.properties index fc281c1f..8219df28 100644 --- a/src/main/resources/application-was1.properties +++ b/src/main/resources/application-was1.properties @@ -1,3 +1,7 @@ + +server.error.whitelabel.enabled=false +server.error.path=/errors + #tomcat tomcat.ajp.protocol=AJP/1.3 tomcat.cluster.enabled=true diff --git a/src/main/resources/application-was2.properties b/src/main/resources/application-was2.properties index 535792a8..d86d3bc3 100644 --- a/src/main/resources/application-was2.properties +++ b/src/main/resources/application-was2.properties @@ -1,3 +1,7 @@ + +server.error.whitelabel.enabled=false +server.error.path=/errors + #tomcat tomcat.ajp.protocol=AJP/1.3 tomcat.cluster.enabled=true