[jsr-314-open] New spec issue 659 - MethodExpressionActionListener.processAction() logs and wraps exceptions in AbortProcessingExceptions
Martin Marinschek
mmarinschek at apache.org
Wed Nov 4 09:37:59 EST 2009
Yeah, well - I originally thought this was the case. But in JSF 2.0,
the UIViewRoot.broadcastEvents code does this:
} catch (AbortProcessingException e) {
context.getApplication().publishEvent(...e...);
so it is even worse than in my first assessment - we have a backwards
compatibility issue. AbortProcessingExceptions should (still, like in
1.2) abort the processing, and not end up in the Exception-Handler.
regards,
Martin
On 11/4/09, Pete Muir <pmuir at redhat.com> wrote:
>
> On 4 Nov 2009, at 05:49, Martin Marinschek wrote:
>
>> Hi guys,
>>
>> See the issue comment for the new spec issue:
>>
>> https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=659
>>
>> below. Please let's please fix this rather soon - I have an ugly hack
>> in place to work around this.
>>
>> ======
>>
>> One case we missed when we decided to fix exception-handling for 2.0:
>>
>> In MethodExpressionActionListener.processAction(), we first do
>> custom logging of
>> an exception, and then rethrow it with:
>>
>> throw cause == null ? new AbortProcessingException(thrown.getMessage
>> (),
>> thrown) : new AbortProcessingException
>> (thrown.getMessage(),
>> cause);
>>
>> which leads to a silently (for the user - not for the logs if they
>> are switched
>> on and available) swallowed exception in the action-listener. I
>> believe the
>> whole exception-handling in this method can be made a lot simpler -
>> we need to
>> check if the user threw an AbortProcessingException (might also be
>> the cause of
>> the ELException) and rethrow that, if not, do nothing - just let the
>> exception
>> bubble up to the exception-handler.
>
> Yup, this was the original intention - that any exception used for
> flow control (ugh!) wasn't passed to exception handler.
>
>
--
http://www.irian.at
Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German
Professional Support for Apache MyFaces
More information about the jsr-314-open-mirror
mailing list