facebook

Using a big foghorn…

  1. MyEclipse IDE
  2.  > 
  3. Feature Requests
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #252415 Reply

    thp
    Member

    when adding a property named “eMail”, “iNumber” or similar to a bean.

    Otherwise it may take hours to figure out that decapitalize() (sometimes) works a bit…. weired.

    Greetz
    thp

    #252427 Reply

    Riyad Kalla
    Member

    I don’t understand this request.

    #252465 Reply

    thp
    Member

    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.

    #252481 Reply

    Riyad Kalla
    Member

    Thank you for the clarification.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Using a big foghorn…

You must be logged in to post in the forum log in