> so i finally got around to playing with the new exception handling
features
> and it occurred to me that it would be really nice if you could specify
the
> bundle that a resource is stored in.  i don't think it would be too big of
a
> headache to do this (simple change to ExceptionHandler, and an addition to
> the struts-config and its parsing logic), but it might lead to a more
> general inconsistency in struts in that resource string keys are always
> associated with bundle specified for the action servlet.  (i.e., you don't
> get to specify the bundle anywhere else.)  is there some a general
> philosophy on this?  maybe sometime long ago someone decided "all resource
> strings will be retrieved from one resource bundle..."

I think, this is a good idea. In project, I am envolved in, we have also
decided
to define Exceptions in separate bundle. But let commiters to decide it.

> also, i just want to make sure i know what's what...  the purpose of
> AppException is just to provide a localizable form of exception, right?
if

I have used EJB terminology where application exceptions (derived from
Exception)
handled differently from runtime exceptions (derived from RuntimeException)
I have planned to introduce a runtime exception parallel to AppException,
but
did not find time to do it.

The main purpose of AppException in Struts is to provide an alternative to
actual action errors handling. Since I see no reason to have hundreds of
exceptions
which are very similar in their nature and just result in different error
message to
be appeared on the screen, I have proposed to use a single exception with
parameterized error message for that purpose.

> so, (and i'm being really nitpicky) why not call it LocalizableException
or
> something a little more descriptive.  and just to be even more nitpicky,
is
> there a reason that AppException's constructor doesn't take an Object
array
> instead of AppException(key, val0, val1, val2, ...)?

I just wanted to be conform with ActionError. Meanwhile there is a
constructor
with such parameters in ActionError so we can put it in AppException as
well.
Nevertheless I thing it is much easy to use key, vak0, val1.. form

> just so i don't get accused of being nothing but critical, i really am
> *very* keen on this feature.  what's not to love?  it's wonderfully simple
> and elegant, not to mention quite useful.  ok, enough gushing...

The original idea comes from Donlan Laine

http://www.mail-archive.com/[email protected]/msg03281.html

>oh yeah, another thing...  ExceptionHandler needs to have a corresponding
>interface.  the struts-config allows you to specify an different exception
>handler for each configured exception, but RequestProcessor always casts
>whatever you specify here as ExceptionHandler, so if you did override it,
>you'd get a ClassCastException.

But if you derive your exception handler from ExceptionHandler, then you
won't
get this exception. Won't you ?

Dmitri Valdin







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

Reply via email to