Skip to content
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

How to configure custom error page for 400 error #574

Open
mahesh-tier1app opened this issue Jan 5, 2025 · 1 comment
Open

How to configure custom error page for 400 error #574

mahesh-tier1app opened this issue Jan 5, 2025 · 1 comment

Comments

@mahesh-tier1app
Copy link

mahesh-tier1app commented Jan 5, 2025

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

image

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

@mahesh-tier1app
Copy link
Author

I found a workaround to hide all information on the 400 error page except the header. To hide we can pass the --secure-error-report-valve flag to the webapp-runner.jar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant