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
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.
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.
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.
Try putting error.html
in /webapps/ROOT/
. This will work if your Tomcat worker is handling all URL requests (yourdomain.com/anything).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With