You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Jeffrey Porter <PO...@WMGMAIL.wmg.warwick.ac.uk> on 2005/10/21 17:47:45 UTC

Value binding - exception: can somone explain?

 

Hello all again,

 

I've got the following tag in my JSP. "UserController.user.surname" is a
string. 

 

<h:inputText id="enteredByUID" value="#{UserController.user.surname}"
maxlength="20" size="20" required="true" />

 

But I get an exception when I try to save the page.

 

javax.faces.el.EvaluationException: Cannot set value for expression
'#{UserController.user.firstName}' to a new value of type
java.lang.String

 

Anyone got any ideas? Or am I being an idiot again and missing the
obvious?

 

Jeff

 


Re: Value binding - exception: can somone explain?

Posted by sp...@indiana.edu.
I guess it should be value = "#{beanname.variablename}". 
I assume usercontroller to be bean name and surname to be variable name. What is
user - ?

-Suba.



Quoting gramani@intellicare.com:

> Not sure but aren't you mixing up "firstName" and "surname" maybe..?
> Geeta
> 
> "Jeffrey Porter" <PO...@WMGMAIL.wmg.warwick.ac.uk> wrote on 10/21/2005 
> 11:47:45 AM:
> 
> > 
> > Hello all again,
> > 
> > I?ve got the following tag in my JSP. ?UserController.user.surname? 
> > is a string. 
> > 
> > <h:inputText id="enteredByUID" value="#{UserController.user.surname}" 
> > maxlength="20" size="20" required="true" />
> > 
> > But I get an exception when I try to save the page.
> > 
> > javax.faces.el.EvaluationException: Cannot set value for expression 
> > '#{UserController.user.firstName}' to a new value of type 
> java.lang.String
> > 
> > Anyone got any ideas? Or am I being an idiot again and missing the 
> obvious?
> > 
> > Jeff
> > 



Re: Value binding - exception: can somone explain?

Posted by gr...@intellicare.com.
Not sure but aren't you mixing up "firstName" and "surname" maybe..?
Geeta

"Jeffrey Porter" <PO...@WMGMAIL.wmg.warwick.ac.uk> wrote on 10/21/2005 
11:47:45 AM:

> 
> Hello all again,
> 
> I?ve got the following tag in my JSP. ?UserController.user.surname? 
> is a string. 
> 
> <h:inputText id="enteredByUID" value="#{UserController.user.surname}" 
> maxlength="20" size="20" required="true" />
> 
> But I get an exception when I try to save the page.
> 
> javax.faces.el.EvaluationException: Cannot set value for expression 
> '#{UserController.user.firstName}' to a new value of type 
java.lang.String
> 
> Anyone got any ideas? Or am I being an idiot again and missing the 
obvious?
> 
> Jeff
>