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