Description
In SharedResourceRequestTarget, Line 186, the code just sets the 404 status when the requested resource was not found which defeats all page not found settings and tomcat error settings:
((WebResponse)response).getHttpServletResponse().setStatus(
HttpServletResponse.SC_NOT_FOUND);
We've got in Application:
mountBookmarkablePage("/error/notfound", NotFoundErrorPage.class);
And in the app's web.xml:
<error-page>
<error-code>404</error-code>
<location>/error/notfound</location>
</error-page>
This works for other cases, but not for this. Probably instead of setStatus a sendError or something like that should be done?
Ways to reproduce:
Create an error page and mount it like shown above. Also add the error-page entry to the web.xml
Now try to access http://host/app/resources/x.y.z (thus requesting the resource x.y.z)
What happens: The ugly default tomcat error page is displayed
What should have happened: The page configured as 404 page should be displayed