Skip to content

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

Closed
@wilkinsona

Description

@wilkinsona

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: supersededAn issue that has been superseded by another

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions