commit
3ac8ce60e8
@ -16,8 +16,11 @@ public class MyErrorController implements ErrorController {
|
|||||||
@RequestMapping(value = "/error")
|
@RequestMapping(value = "/error")
|
||||||
public String handleError(HttpServletRequest request) {
|
public String handleError(HttpServletRequest request) {
|
||||||
|
|
||||||
Integer statusCode =
|
Object status = request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE);
|
||||||
Integer.valueOf(request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE).toString());
|
|
||||||
|
if (status != null) {
|
||||||
|
|
||||||
|
Integer statusCode = Integer.valueOf(status.toString());
|
||||||
|
|
||||||
if(statusCode == HttpStatus.NOT_FOUND.value()) {
|
if(statusCode == HttpStatus.NOT_FOUND.value()) {
|
||||||
return "error-404";
|
return "error-404";
|
||||||
@ -25,9 +28,8 @@ public class MyErrorController implements ErrorController {
|
|||||||
else if(statusCode == HttpStatus.INTERNAL_SERVER_ERROR.value()) {
|
else if(statusCode == HttpStatus.INTERNAL_SERVER_ERROR.value()) {
|
||||||
return "error-500";
|
return "error-500";
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return "error";
|
|
||||||
}
|
}
|
||||||
|
return "error";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,7 +1,14 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous" />
|
||||||
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
|
||||||
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Sorry we couldn't find the resource you are looking for</h1>
|
<div class="container">
|
||||||
<a href="/">Go Home</a>
|
<div class="jumbotron" >
|
||||||
|
<h1 class="text-center"><i class="fa fa-frown-o"> </i> Sorry, we couldn't find the page you were looking for. </h1>
|
||||||
|
<p class="text-center"><a class="btn btn-primary" href="/"><i class="fa fa-home"></i>Go Home</a></p>
|
||||||
|
</div></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -1,7 +1,16 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous" />
|
||||||
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
|
||||||
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Oops! We spilled something but we're fixing it</h1>
|
<div class="container">
|
||||||
<a href="/">Go Home</a>
|
<div class="jumbotron" >
|
||||||
|
<h1 class="text-center"><i class="fa fa-frown-o"> </i> Sorry, something went wrong! </h1>
|
||||||
|
|
||||||
|
<h2 class="text-center">We're fixing it.</h2>
|
||||||
|
<p class="text-center"><a class="btn btn-primary" href="/"><i class="fa fa-home"></i>Go Home</a></p>
|
||||||
|
</div></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -1,7 +1,16 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous" />
|
||||||
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
|
||||||
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Something went wrong! Our Engineers are on it temp</h1>
|
<div class="container">
|
||||||
<a href="/">Go Home</a>
|
<div class="jumbotron" >
|
||||||
|
<h1 class="text-center"><i class="fa fa-frown-o"> </i> Something went wrong! </h1>
|
||||||
|
|
||||||
|
<h2 class="text-center">Our Engineers are on it.</h2>
|
||||||
|
<p class="text-center"><a class="btn btn-primary" href="/"><i class="fa fa-home"></i>Go Home</a></p>
|
||||||
|
</div></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<body>
|
|
||||||
<h1>Welcome Home</h1>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Loading…
x
Reference in New Issue
Block a user