Yes are correct in stating that the 404 error is not an exception... it is
simply file not found error and must be handled seperatly from exception
errors.
I am currently exploring the exception error handling/page myself.
You can get the URL of the page as follows:

In the page you have the error, you put:
<% request.setAttribute("sourcePage", request.getRequestURI()); %>

then in your exception error page defined in web.xml (JSP) you get the URI
by:
<% request.getAttribute("sourcePage"); %>

You would usually write the error URL in your log file for debugging allong
with the rest of the exception info.

There are probably many beans available on the web that will do this quit
nicely, but where is the fun in that?
:)
Barry


----- Original Message -----
From: "Fabien Modoux" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 16, 2001 11:32 AM
Subject: error-page usage in web.xml


> Hello,
>
> I am having trouble understanding how to properly configure
> the error-page section of my web.xml. I found some previous
> posts, but could not find enough information.
>
> There are two types of error-page element: exception-type and
> error-code. Are those complimentary -- i.e., they must both be
> defined to handle all errors -- or is there some sort of overlap?
> I did a few tests and I don't think 404 cannot be handled as an
> exception, only with the error-code element. However I am
> wondering about the difference between error-code 500 and
> exception-type java.lang.Throwable, which one is the most general
> one?
>
> I've also seen a post (#33290) saying that
>
> > Within the page, you can access (among others) the following request
> > attribute created by the container:
> >
> >   <%
> >     String requestURI = (String)
> >      request.getAttribute("javax.servlet.error.request_uri");
> >   %>
>
> I am using TC3.2.2 and the attribute has the value of the error
> handler page, not of the page that created the error. Is the possible
> to get the latter info?
>
> Thanks for your help,
>
> -Fabien
>
> ---------------------------------------------
> Fabien Modoux,
> Voicemate - http://www.voicemate.com
>
> --
> To unsubscribe:   <mailto:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to