You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Dave <ja...@yahoo.com> on 2006/03/04 05:14:01 UTC

model update error : hide exception

During model update phase, if a setter method throws an exception,
  For example, setUsername(String username)
   
  Faces  will display a message:
        Conversion Error "username": Error during model data update
   
  and in the meantime display a stack trace on server side console.
   
  How to 
  1. replace the message with  "Invalid user name: xyz"?
  2. prevent displaying stack trace on server side since it is a normal error caused by clients ?
   
  Thanks for help! 
   
   
   
   

		
---------------------------------
Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze. 

Re: model update error : hide exception

Posted by ja...@sirma.bg.
I would suggest that you use a validator before update the model. This could be
either a method in your backing bean or a separate class. Or, if appropriate,
you could use some of the predefined validators (like Tomahawk's
validateRegExpr).
Thus you'll have control over the message.

Quoting Dave <ja...@yahoo.com>:

> During model update phase, if a setter method throws an exception,
>   For example, setUsername(String username)
>    
>   Faces  will display a message:
>         Conversion Error "username": Error during model data update
>    
>   and in the meantime display a stack trace on server side console.
>    
>   How to 
>   1. replace the message with  "Invalid user name: xyz"?
>   2. prevent displaying stack trace on server side since it is a normal error
> caused by clients ?
>    
>   Thanks for help! 
>    
>    
>    
>    
> 
> 		
> ---------------------------------
> Yahoo! Mail
> Bring photos to life! New PhotoMail  makes sharing a breeze.