admin管理员组

文章数量:1315777

I need to change the default Jetty error page (specifically I want to remove the part where the requested URI appears in the html response), I tried several things but it does not seem to work.

I expect that when I do a GET to an endpoint that is configured for POST only, get the custom error page defined in my file 405.html, but currently I keep getting the default jetty error page.

I needed to do the same but for 404 errors and it worked perfectly, just by adding the following to my web.xml file:

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

I tried to do the same but for 405 error, and it didn't work. I have searched for documentation but it seems like no one ever has faced this same issue.

本文标签: javaHow can I change jetty default 405 error pageStack Overflow