-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closes #95 Create 404 Page #385
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.faforever.api.error; | ||
|
||
import org.springframework.http.HttpStatus; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
|
||
import javax.servlet.RequestDispatcher; | ||
import javax.servlet.http.HttpServletRequest; | ||
|
||
@Controller | ||
public class ErrorController implements org.springframework.boot.web.servlet.error.ErrorController { | ||
@RequestMapping("/error") | ||
public String handleError(HttpServletRequest request) { | ||
Object status = request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE); | ||
|
||
if (status != null) { | ||
Integer statusCode = Integer.valueOf(status.toString()); | ||
|
||
if (statusCode == HttpStatus.NOT_FOUND.value()) { | ||
return "404"; | ||
} | ||
} | ||
return "error"; | ||
} | ||
|
||
@Override | ||
public String getErrorPath() { | ||
return "/error"; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<html xmlns:th="http://www.thymeleaf.org"> | ||
<head> | ||
<meta charset="UTF-8"/> | ||
<title>Not Found</title> | ||
|
||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> | ||
<link href="https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz" rel="stylesheet" type="text/css"> | ||
<link href="https://faforever.com/styles/css/site.min.css" rel="stylesheet" type="text/css"/> | ||
<link rel="stylesheet" th:href="@{/css/style.css}" type="text/css"/> | ||
</head> | ||
<body> | ||
<div class="background hero"></div> | ||
<h1 class="primary-color" style="position: fixed; top: 30%; left: 20%;">You will get what you have asked for. | ||
Nothing...</h1> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<html xmlns:th="http://www.thymeleaf.org"> | ||
<head> | ||
<meta charset="UTF-8"/> | ||
<title>Not Found</title> | ||
|
||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> | ||
<link href="https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz" rel="stylesheet" type="text/css"> | ||
<link href="https://faforever.com/styles/css/site.min.css" rel="stylesheet" type="text/css"/> | ||
<link rel="stylesheet" th:href="@{/css/style.css}" type="text/css"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BTW: How does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's some thymeleaf stuff |
||
</head> | ||
<body> | ||
<div class="background hero"></div> | ||
<h1 class="primary-color" style="position: fixed; top: 30%; left: 20%;">Oops... Something went wrong!</h1> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same, more commander like stuff. |
||
</body> | ||
</html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish we had something more like
supreme commander
information.Like:
Or
Or:
etc...