heroku / heroku/webapp-runner

How to configure custom error page for 400 error

Open
#574 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
323
Forks
111
Avg merge
8h 41m
Merged PRs (30d)
17

Description

When I access malformed URIs in my application, the server redirects to Tomcat's default 400 error page, as shown below:

![image](https://github.com/user-attachments/assets/42354797-1e92-4246-b49e-983a7050c466)

I want to display a custom error page instead of the default one. To achieve this, I configured the `ErrorReportValve` using the following attributes:

`-AclassName="org.apache.catalina.valves.ErrorReportValve" -AerrorCode.400="webapps/expanded/400-custom-error.html" -AshowReport=false -AshowServerInfo=false`

Despite this configuration, the custom error page does not appear. The default Tomcat error page is still displayed.

Could you please confirm if this is the correct approach or let me know if I am missing any steps?

**Environment Details:**

OS: Windows
Java Version: JDK17
Webapp-runner Version: 9.0.97

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.