Skip to content

How to configure custom error page for 400 error #574

@mahesh-tier1app

Description

@mahesh-tier1app

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions