David Smith wrote:

> Essentially you're
looking for this in web.xml:

<error-page>
  <error-code>404</error-code>
  <location>/some/error/page.jsp</location>
</error-page>

There's also a version for dealing with exceptions:

<error-page>
  <exception-type>java.io.IOException</exception-type>
  <location>/some/error/page.jsp</location>
</error-page>

Just make sure you use this at the top of you web.xml file to insure you
get spec 2.4 processing:

<web-app xmlns="http://java.sun.com/xml/ns/j2ee";
                 xmlns:xsi="http://www.w3c.org/2001/XMLSchema-instance";
                 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";
                 version="2.4">

We use only JSPs, and all our apps currently conform to 2.2, the
oldest spec which provides everything we need.  Some of our
customers run ageing web app servers like WebLogic 6.1 and old
Tomcats; might they baulk at a 2.4 web.xml?  Since every JSP
nominates an error page, presumably that catches exceptions,
and we only need to handle nonexistent-page errors?  I'll
re-read the 2.2 spec...

Paul Singleton


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.8/71 - Release Date: 12/Aug/2005


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to