0

I'm trying to set a user friendly 404.html. I'm following this answer

I added <error-page> tag to web.xml file that was in the conf folder C: . . .\apache-tomee-webprofile-1.7.4\conf\web.xml as following

<error-page>
    <error-code>404</error-code>
    <location>/PageNotFound.html</location>
</error-page>

However, when I start Tomee, it would rewrite this web.xml with all it's default values. As if I never made any changes. Why?

Community
  • 1
  • 1

1 Answers1

0

Typically error pages are deployed in the application, not at the server level. The web.xml at the server level defines the properties for the default servlet though, so technically that should work.

Are you starting the application from the command line or from your IDE? When I start it from the command line, your exact change stays in the web.xml. Sometimes your IDE can do funny things with your deployment descriptors if you're starting it from there.

Jonathan S. Fisher
  • 8,189
  • 6
  • 46
  • 84