java.beans.Introspector
public static String decapitalize(String name)
Utility method to take a string and convert it to normal Java variable name capitalization. This normally means converting the first character from upper case to lower case, but in the (unusual) special case when there is more than one character and both the first and second characters are upper case, we leave it alone.
Thus “FooBah” becomes “fooBah” and “X” becomes “x”, but “URL” stays as “URL”.
Parameters:
name – The string to be decapitalized.
Returns:
The decapitalized version of the string.
This method is used to assosiate the property names in a jsp to the getter/setter methods of the underlying form bean.
Name in the form bean wizard: email
Setter/getter: setEmail/getEmail, converted by decapitalize() to email
Name of property in jsp: email
works as expected!
Name in the form bean wizard: eMail
Setter/getter: setEMail/getEMail, resolved by decapitalize() to EMail
Name of property in jsp : must be EMail, but MyEclipse generates “eMail”, the same name I would have taken (by habit)
Works as designed, not as expected!
It took a while for me to figure out what’s going wrong when getting error msgs from Tomcat like “can’t find value for…” in generated code, and the code looks pretty fine!
Ok, you can also call it a bug in MyEclipse, because it generated the same wrong code I would write.
So IMHO the best solution is to give a hint when adding such a property.