You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by David Johnson <ch...@gmail.com> on 2005/05/26 20:33:37 UTC

not catching errors...

Hi all
 I've added the following to my web.xml (thanks for the help)
  
<error-page>
<error-code>500</error-code>
<location>/error.jsp</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/error.jsp</location>
</error-page>
<error-page>
<error-code>java.lang.Exception</error-code>
<location>/error.jsp</location>
</error-page>

and I've added a global forward I invoke from "error.jsp" which points to my 
tiles def as follows

<forward name="error" path="/page.error" />

the problem is when I cause an error (like stopping the database then trying 
to hit it or reloading a page that should cause an error 500), I'm not 
seeing my error page.

am I forgetting something?


-- 
-Dave
ChaChaNY@Gmail.com

Re: not catching errors...

Posted by Jason Lea <ja...@kumachan.net.nz>.
Have you tried testing in Firefox to see if you get the same result.

Internet Explorer may be confusing the issue:

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807

"Several frequently-seen status codes have "friendly" error messages 
that Internet Explorer 5./x/ displays and that effectively mask the 
actual text message that the server sends. However, these "friendly" 
error messages are only displayed if the response that is sent to the 
client is less than a specified threshold. *For example, to see the 
exact text of an HTTP 500 response, the content length must be greater 
than or equal to 512 bytes. *"

So you might have to pad out your response with commented html or 
something for the message to show.

David Johnson wrote:

>Hi all
> I've added the following to my web.xml (thanks for the help)
>  
><error-page>
><error-code>500</error-code>
><location>/error.jsp</location>
></error-page>
><error-page>
><error-code>404</error-code>
><location>/error.jsp</location>
></error-page>
><error-page>
><error-code>java.lang.Exception</error-code>
><location>/error.jsp</location>
></error-page>
>
>and I've added a global forward I invoke from "error.jsp" which points to my 
>tiles def as follows
>
><forward name="error" path="/page.error" />
>
>the problem is when I cause an error (like stopping the database then trying 
>to hit it or reloading a page that should cause an error 500), I'm not 
>seeing my error page.
>
>am I forgetting something?
>
>
>  
>

-- 
Jason Lea