struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Shale] Changing String type to HtmlInputText in Backingbean gives No Propertyeditor error
Date Thu, 13 Oct 2005 20:51:22 GMT
I *finally* had time to download and build Shale from source and I did 
notice that error(UICompnenet, String) is indeed fixed (thank you again, 
Ronald Holshausen:)).. So anyway i decided to make parallel changes to 
another of my backing bean's attributes.

So my jsp has this:
<h:inputText id="userName" required="true"
                                value="#{registration.userName}" />
<h:inputSecret id="password" required="true"
                                binding="#{registration.password}" />

My backingbean RegistrationBean has the following:

private HtmlInputText userName = null;
private HtmlInputSecret password = null;
with appropriate getters and setters.

However when i try to show that jsp, I get the foll. error:
javax.faces.el.EvaluationException: Cannot set value for expression 
'#{registration.userName}' to a new value of type java.lang.String
Caused by: javax.servlet.jsp.el.ELException: Attempt to convert String 
"Geeta" to type "javax.faces.component.html.HtmlInputText", but there is 
no PropertyEditor for that type

I suppose I can convince myself why this is a problem - and sure enough if 
I change userName to be a String instead everything is hunky-dory.. But 
here's my question. If I change userName a String userName,  **but keep 
password still as HtmlInputSecret**, things still work.  My thought is 
that my app should gag with password being of type HtmlInputSecret too and 
ought to demand that it be of type String too..? What is the explanation 
for this seeming discripency? And more importantly, what should I do to 
fix the code so that i can declare userName as HtmlInputText?

Thanks in advance for your help,
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message