exception : exception page(springboot)
This commit is contained in:
@@ -6,7 +6,7 @@ import org.springframework.boot.web.server.WebServerFactoryCustomizer;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
//@Component
|
||||
public class WebServerCustomizer implements WebServerFactoryCustomizer<ConfigurableWebServerFactory> {
|
||||
@Override
|
||||
public void customize(ConfigurableWebServerFactory factory) {
|
||||
|
||||
@@ -21,6 +21,11 @@ public class ServletExController {
|
||||
response.sendError(404, "404 오류!");
|
||||
}
|
||||
|
||||
@GetMapping("/error-400")
|
||||
public void error400(HttpServletResponse response) throws IOException {
|
||||
response.sendError(400, "400 오류!");
|
||||
}
|
||||
|
||||
@GetMapping("/error-500")
|
||||
public void error500(HttpServletResponse response) throws IOException {
|
||||
response.sendError(500);
|
||||
|
||||
17
exception/src/main/resources/templates/error/404.html
Normal file
17
exception/src/main/resources/templates/error/404.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container" style="max-width: 600px">
|
||||
<div class="py-5 text-center">
|
||||
<h2>404 오류 화면 스프링 부트 제공</h2>
|
||||
</div>
|
||||
<div>
|
||||
<p>오류 화면 입니다.</p>
|
||||
</div>
|
||||
<hr class="my-4">
|
||||
</div> <!-- /container -->
|
||||
</body>
|
||||
</html>
|
||||
17
exception/src/main/resources/templates/error/4xx.html
Normal file
17
exception/src/main/resources/templates/error/4xx.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container" style="max-width: 600px">
|
||||
<div class="py-5 text-center">
|
||||
<h2>4xx 오류 화면 스프링 부트 제공</h2>
|
||||
</div>
|
||||
<div>
|
||||
<p>오류 화면 입니다.</p>
|
||||
</div>
|
||||
<hr class="my-4">
|
||||
</div> <!-- /container -->
|
||||
</body>
|
||||
</html>
|
||||
17
exception/src/main/resources/templates/error/500.html
Normal file
17
exception/src/main/resources/templates/error/500.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container" style="max-width: 600px">
|
||||
<div class="py-5 text-center">
|
||||
<h2>500 오류 화면 스프링 부트 제공</h2>
|
||||
</div>
|
||||
<div>
|
||||
<p>오류 화면 입니다.</p>
|
||||
</div>
|
||||
<hr class="my-4">
|
||||
</div> <!-- /container -->
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user