I am looking at UIInput.java.
 
   public void updateModel(FacesContext context)
    {
        if (!isValid()) return;
        if (!isLocalValueSet()) return;
        ValueBinding vb = getValueBinding("value");
        if (vb == null) return;
        try
        {
            vb.setValue(context, getLocalValue());
            setValue(null);
            setLocalValueSet(false);
        }
        catch (RuntimeException e)
        {
     &nbs p;   //Object[] args = {getId()};
            context.getExternalContext().log(e.getMessage(), e);
            _MessageUtils.addErrorMessage(context, this,CONVERSION_MESSAGE_ID,new Object[]{getId()});
            setValid(false);
        }
    }
 
 
The method just log the exception, and what shows up on page is predefined conversion error message. I like the error message from the exception to show up on page telling user what is wrong. The predefined message says nothing more than an Model update error.
This is a bug.  Thanks. Dave

Mike Kienenberger <[EMAIL PROTECTED]> wrote:
It's not a bug, but it certainly makes it more difficult to write
meaningful error messages.

I'm taking a look at the UIInput code, and it looks like you can
provide a FacesMessage on your ConverterException constructor call.
If you do that, the FacesMessage you provide will be used instead of
building one using javax.faces.component.UIInput.CONVERSION.

I guess that's not so bad, and it'll probably do what you want.


On 11/2/05, Dave <[EMAIL PROTECTED]>wrote:
> I throw my own exception, I hope JSF to catch the exception and display the
> message from the exception. but JSF just display its own message. This might
> be a bug.
>
> Mike Kienenberger <[EMAIL PROTECTED]>wrote:
> The message comes from the messages.properties file:
>
> javax.faces.component.UIInput.CONVERSION = Conversion Error
> javax.faces.component.UIInput.CONVERSION_detail = "{0}":
> Error during
> model data update.
>
> I'm guessing you'd need to provide your own message bundle that
> provides an alternate value.
>
> On 11/1/05, Dave wrote:
> > How to catch exception during model update phase and display a nicer
> > message?
> >
> > There was an exception during model update, but I did not catch it, the
> > error message on the screen is:
> >
> > Conversion Error "_id30": Error during model data update.
> >
> > If I catch exception, the life cycle will continue to Invoke Application,
> > that is not desired.
> >
> > Thanks, dave
> >
> > ________________________________
> > Yahoo! FareChase - Search multiple travel sites in one click.
> >
> >
>
>
> ________________________________
> ; Yahoo! FareChase - Search multiple travel sites in one click.
>
>


Yahoo! FareChase - Search multiple travel sites in one click.

Reply via email to