struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Husted" <ted.hus...@gmail.com>
Subject Re: Declarative Exception Handling
Date Sun, 23 Apr 2006 16:29:01 GMT
On 4/21/06, Asad Habib <ahabib@engin.umich.edu> wrote:
> When using declarative exception handling, where do you create the
> exception instances? In the action itself?

Yes. The framework first catches all exceptions thrown by an Action.
Then, it looks to see if there's an exception handler for that
exception instance. If so, the exception is delegated to the handler.
Otherwise, it's re-thrown.

> I would like to use the
> ModuleException class and pass a resource key to the constructor but
> don't know where this should be accomplished.

Me neither. You may need to subclass it or something.

> On another note, are there
> any resources online which demonstrate how to use the validator and
> declarative exceptions together?

Hmmm, not sure how that would work. The validator fires before the
Action, and the declarative exception handler is tied to the Action.
The MailReader applications throws a "password expired" exception,
which is like a validation, but it's not part of the cannoncail, "do
we even submit this request to the Action" validation.

> I have browsed through several Struts
> books but have not seen any examples of both of these being used together.
> Any help would be appreciated. Thank you.
>
> - Asad
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message