Tomcat blankpage for default error page
First off, I'm using Tomcat 5.5 and my .jsp's live in /webapps/foo/bar/*.jsp.
I followed the directions here to set up a default 404 error page. In my TOMCAT_HOME/conf/web.xml I entered:
<error-page>
<error-code>404</error-code>
<location>/error.html</location>
</error-page>
I dropped copies of a test error.html file into each of the dirs (I wasn't sure where /error.html was referring to):
/webapps/
/webapps/foo/
/webapps/foo/bar/
Whenever I attempt to access a non-existent page in a browser at url's /foo/missingpage.html or /foo/bar/missingpage.html I'm redirected to my error page that exists in /foo/error.html.
However, attempting to access a non-existent page in a browser at url /missingpage.html yields a blankpage. Or any permutation of /mis开发者_运维技巧singDir/missingfile.html will also yield a blank page. Any suggestions? Am I missing some extra configuration?
Thanks
PR
Try putting error.html
in /webapps/ROOT/
. This will work if your Tomcat worker is handling all URL requests (yourdomain.com/anything).
精彩评论