Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 /missingDir/missingfile.html will also yield a blank page. Any suggestions? Am I missing some extra configuration?

Thanks

PR

like image 645
praspa Avatar asked Apr 13 '10 11:04

praspa


People also ask

Where is the default error page in Tomcat?

The default Tomcat error page exposes the Tomcat version that SDM is using. After the above changes, when the SDM URL is accessed via http://<SD server hostname>:<port#>/abc, a screen similar to the following will appear that does not have the Tomcat version listed.

How do I create a custom error page for when Tomcat is down for maintenance?

On the ErrorDocument line, we specify the error code, which in this case is a 503. After that, we can specify either a text message or the page to display. I'll specify to display the "maintenance-message. html" page, which I create in the Apache document root directory, which in my case is in my Apache2.

What is HTTP Status Error 404 Tomcat?

The error code is HTTP 404 (not found) and the description is: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. This error means the server could not find the requested resource (JSP, HTML, images…) and returns HTTP status code 404.


1 Answers

Try putting error.html in /webapps/ROOT/. This will work if your Tomcat worker is handling all URL requests (yourdomain.com/anything).

like image 181
Zak Linder Avatar answered Oct 10 '22 11:10

Zak Linder