|Why are custom 404 handlers not supported?||Jim McCabe||8/6/09 10:39 PM|
In the documentation about the web.xml deployment descriptor file, it
seems to indicate that 404 error pages are not supported. However it
says it in a strange way that could also be understood to say that you
can't change the specific numerical code that it returns for a page-
not-found (ie return 401 instead of 404, etc). Here's the actual text
from the article:
"Specifically, you cannot customize the 404 response code when no
servlet mapping is defined for a URL"
So I tried to make an error handler, by defining an error-page entry
in web.xml. It works great for local testing, but not on the deployed
Since this is not consistent, I'm wondering if this is something that
is not supposed to be supported at all, or something that I did wrong
so that it doesn't work in the deployed app?
If not supported at all, why? What is so evil about a 404 handler?
|Re: Why are custom 404 handlers not supported?||Peter Ondruška||8/6/09 11:21 PM|
|Re: [appengine-java] Why are custom 404 handlers not supported?||Don Schwarz||8/7/09 8:08 AM|
Your first interpretation of the article is correct. The word "code" should probably be removed.
As for making this work transparently, please star Peter's issue so we can prioritize this feature.
However, if you're looking for a workaround you can try specifying a 404 error handler and also adding a no-op Filter at /* (i.e. a Filter that just forwards all requests to the FilterChain).
|Re: [appengine-java] Re: Why are custom 404 handlers not supported?||Jason (Google)||8/11/09 1:44 PM|
Agreed that the documentation is a bit ambiguous in its meaning. This will be taken care of soon.
|Re: [appengine-java] Re: Why are custom 404 handlers not supported?||Jason (Google)||8/11/09 1:45 PM|
As an aside, you shouldn't have to use a filter. I believe you can create a servlet mapping for /* that gets executed after all other mappings above it fail to match. Then you can redirect to a custom error page.