[prev in list] [next in list] [prev in thread] [next in thread] 

List:       myfaces-user
Subject:    Re: Validation message frustration
From:       Gary Jackson <bargle () umiacs ! umd ! edu>
Date:       2007-07-31 22:52:03
Message-ID: 46AFBD13.5080208 () umiacs ! umd ! edu
[Download RAW message or body]

Gary Jackson wrote:
> public class Bean {
>     ...
>     public void validateAttribute(FacesContext context, UIComponent 
> component, Object object) throws ValidatorException {
>         throw new ValidatorException(new 
> FacesMessage(FacesMessage.SEVERITY_ERROR, "summary", "detail"));
>     }
>     ...
> }

I followed this down the rabbit hole as far as I could today. 
Somewhere, the FacesMessage component of the ValidatorException, though 
not the ValidatorException itself, is getting eaten when the validator 
method is invoked from _ComponentUtils.callValidators().  I can work 
around this by explicitly setting the validatorMessage attribute on the 
UIInput component passed in to the validator method and also throwing 
the exception.  Nevertheless, this really seems like a bug in MyFaces.

-- 
Gary
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic