Skip to content

Custom error.jsp page is not used when app is run with mvn spring-boot:run #12805

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

Closed
wilkinsona opened this issue Apr 9, 2018 · 1 comment
Closed
Labels
status: superseded An issue that has been superseded by another

Comments

@wilkinsona
Copy link
Member

wilkinsona commented Apr 9, 2018

The problem can be reproduced using spring-boot-sample-web-jsp with a src/main/webapp/WEB-INF/jsp/error.jsp with the following contents:

<!DOCTYPE html>
<html lang="en">
<body>
Something went wrong: ${status} ${error}
</body>
</html>
  1. $ mvn spring-boot:run
  2. $ curl :8080/foo -H "Accept:text/html"
<html><body><h1>Whitelabel Error Page</h1><p>This application has no explicit mapping for /error, so you are seeing this as a fallback.</p><div id='created'>Mon Apr 09 14:27:21 BST 2018</div><div>There was an unexpected error (type=Internal Server Error, status=500).</div><div>Foo</div></body></html>

By contrast, it works when packaged as a war:

  1. $ mvn clean package
  2. $ java -jar target/spring-boot-sample-web-jsp-2.0.2.BUILD-SNAPSHOT.war
  3. curl :8080/foo -H "Accept:text/html"
<!DOCTYPE html>
<html lang="en">
<body>
Something went wrong: 500 Internal Server Error
</body>
</html>

The problem occurs in both 1.5 and 2.0.

@wilkinsona
Copy link
Member Author

Closing in favour of the PR (#12859).

@wilkinsona wilkinsona added status: duplicate A duplicate of another issue and removed type: bug A general bug labels Jun 21, 2018
@wilkinsona wilkinsona removed this from the 1.5.x milestone Jun 21, 2018
@philwebb philwebb added status: superseded An issue that has been superseded by another and removed status: duplicate A duplicate of another issue labels Sep 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another
Projects
None yet
Development

No branches or pull requests

2 participants