On Mon, 9 Aug 2004 22:06:51 -0300 (ART), Leandro Melo
<[EMAIL PROTECTED]> wrote:
> Hi,
> i'm now starting to deal with exception in my
> application.
> 
> So far, i haven't used Struts exception handling
> alternatives, so, i'm very new at that.
> 
> After some reading i have a few questions (please mark
> True of False on my sentences , naturally comments are
> welcome!).
> 
>    * It seems to me that Struts has a very nice way
> to deal with Exceptions, and i actually should use
> that.

True !

> 
>    * Is it nice to have locals exceptions handlers
> for my Action, or i should just have a few (or one)
> global Exception Handler?

True (If required) Having LocalException Handlers will give the
functionality of handling a particular exception differently, if
required.

> 
>    * When do i need to override ExceptionHandler? I
> couldn't figure it out a situation where it's needed
> (maybe if i want to do some special logs for every
> exceptions??? ).
> 

One scenario might be to handle NestedException, You might override
execute(Exception ex, ExceptionConfig config, ActionMapping mapping,
ActionForm form, HttpServletRequest request, HttpServletResponse
response) method of ExceptionHandler to show error messages for all
the exceptiosn.

>    * Here's an advice from jakarta: " A common use of
> ExceptionHandlers is to configure one for
> java.lang.Exception so it's called for any exception
> and log the exception to some data store.".
>      Is it really a nice strategy???
> 

Well Sure, first a local ExceptionHandler is invoked if found,
otherwise, the global
ExceptionHandlers are searched, if not, the Exception's superclass are
searched in a similar fashion. So, declaring a handler for
java.lang.Exception, will always be there for you as a default handler
for any type of Exception, if you haven't defined a specific handler
for that particular exception.


> Well, i think this is it! I'd appreciate some comments.
> 
> =====
> _________________________________
> Leandro Terra C. Melo
> Eng. de Controle e Automação - UFMG
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

Thanks,

Kishore Senji.

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

Reply via email to