Thanks. I got this working, but what about 404 errors outside the
context?
On Dec 3, 2004, at 10:51 AM, Scott Purcell wrote:
The deployment descriptor will allow the following:
<error-page>
<error-code>404</error-code>
<location>/errorpage.jsp</location>
</error-page>
Give this a try and all 404 errors caught by the context will be sent
to the errorpage.jsp file. Also check the docs, as there are other
attributes that get set to help diagnose the error better.
javax.servlet.error.status_code
javax.servlet.error.exception_type
javax.servlet.error.message
javax.servlet.error.exception
javax.servlet.error.request_uri
javax.servlet.error.servlet_name
Also the error-type can be a exception-type
<!ELEMENT error-page( ( error-code | exception-type), location)>
Good luck
Scott K Purcell
-----Original Message-----
From: Frank Morton [mailto:[EMAIL PROTECTED]
Sent: Friday, December 03, 2004 9:43 AM
To: Tomcat Users List
Subject: 404 capture anywhere without apache
Another view of a previous post...
I have a context currently defined in server.xml as:
<Context path="/mycity" docBase="mycity" debug="9"
reloadable="true" crossContext="true" >
<Loader checkInterval="5" />
<Logger
className="org.apache.catalina.logger.SystemOutLogger" timestamp="true"
/>
</Context>
I would like to catch any 404 errors (with <error-page> or otherwise),
even outside the context, and redirect to one specific url within the
mycity context (and still be able to see the original url to redirect
appropriately). All without running apache to do the redirecting.
So, if someone browses to http://MYHOST, since there is no root
context, it could get redirected to a servlet within the mycity
context.
If someone browses to http://MYHOST/something, it would also be
rerouted and I'd be able to grab the original url with getRequestURL().
Anyone know how to do this?
Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]