Craig,
Your suggestion planted a seed with me that has grown into a perfect
solution.
Thanks,
Frank.

----- Original Message ----- 
From: "Craig McClanahan" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Sunday, April 18, 2004 1:42 AM
Subject: Re: A better exception-handling strategy?


> Frank Burns wrote:
>
> >I want to have a consistent display of exceptions that occur in my
> >Struts-based applciation.
> >
> >For exceptions that occur in my Action classes, I use the declarative
> >exception handling mechanism and forward to a set of "exception pages"
that
> >I have created. However, the declarative exception handling mechanism is
> >only applicable to Action classes.
> >
> >My problem is that I call some JSPs that utilize beans (via JSTL) that
have
> >getter methods which perform database access. These getter methods can
> >generate exceptions. When these exceptions occur I'd like to display one
of
> >the set of "exception pages" that I've created.
> >
> >The best solution I have thought of so far is to place JSTL "catch" tags
> >into the JSPs and when they catch exceptions I use a JSTL "redirect" tag
to
> >redirect to one of my "exception pages".
> >
> >It works. But is there a better strategy than this?
> >
> >
> You might want to experiment with the standard exception mapping
> facilities that web.xml supports, for use whenever an exception ripples
> all the way up to the servlet container.  For example, you can deal with
> any NPE that gets thrown with an entry like this:
>
>   <error-page>
>     <exception-type>java.lang.NullPointerException</exception-type>
>     <location>/error-page.jsp</location>
>   </error-page>
>
> >Thanks,
> >
> >Frank
> >
> >
> >
> Craig
>
>
> ---------------------------------------------------------------------
> 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]

Reply via email to