Hmmm, if anyone is relying on the current behavior then this is not a backward compatible change.

Plus, even if the user can't fix the issue, don't they need to know there is an issue, because the model update did indeed fail. At a minimum isn't some message saying an error occurred required?

Looking at the link Matthias sent here's what it will do in jsf 2.0? Does this look right?

   * they added support for setting exception handlers on facesContext
     (or is this supported now, I'm not familiar with this if it's
     supported in 1.2).
   * in the updateModel code when they find an exception they wrap it
     in an updateModelException, so it doesn't look like they expect
     this exception to be thrown from the model, they are actually
     creating one of these in the UIInput.updateModel method.
   * pass the UpdateModelException to the exception handler.



So in theory in jsf 2.0 the user could wire up an exception handler configured to not add a faces message for certain types of exceptions?

Without the ability to configure an exception handler now I still think Min's original solution to fire a special exception to tell updateModel not to add a messageseems reasonable, not to mention backward compatible. We could add it as deprecated assuming we could wire up our own exception handler in jsf 2.0?


Thanks,

Gab



Min Lu wrote:
The patch below is for message reformat. We need a solution to skip reporting 
message.

Since other than ValiatorException, the end users cannot fix other types of exception, we can change the updateModel() logic to only report error messages for ValidatorException type. If error messages are reported by the model layer already, model layer can throw a RuntimeException to indicate failure to updateModel but let updateModel skip reporting errors.

Thanks,
Min

-----Original Message-----
From: Matthias Wessendorf [mailto:[email protected]] Sent: Monday, February 16, 2009 12:21 AM
To: MyFaces Development
Subject: Re: [Trinidad] Introduce UpdateModelSkipMessageException

Hi Min,

Looks like the JSF 2.0 spec will contain an UpdateModelException, see
the gobal exception_handling item in their bug-system:
https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=248

and the proposed patch:
https://javaserverfaces-spec-public.dev.java.net/nonav/issues/showattachment.cgi/186/changebundle.txt

Greetings,
Matthias

On Sun, Feb 15, 2009 at 10:19 PM, Matthias Wessendorf
<[email protected]> wrote:
Hi,
IMO this makes sense. I think I saw an item for JSF 2 that does this too. If
possible we should take a look at it so that our solution is not to
different from the standard.

Sent from my iPod.
On 15.02.2009, at 19:48, Min Lu <[email protected]> wrote:

I would like to propose that we introduce a new exception class
UpdateModelSkipMessageException extends RuntimeException, which indicates
failure in UpdateModel phase, however the error message has been added in
the model layer for reporting, so UpdateModel can skip adding the message
for this type of exception (done at the end of
UIXEditableValue.updateModel() ).



Thanks,

Min Lu





Reply via email to