You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Steve Armstrong <sa...@wrappedapps.com> on 2002/02/18 18:33:27 UTC

RE: BeanUtil BUG (this is actually correct behaviour)

Fernando Esteban Barril Otero [mailto:fernando@visionnaire.com.br] writes:

I think that is the normal behavior for JavaBean properties.
When you have a setter/getter for a property starting with
more than one upper char, the property name must have exactly
the same name (without the "normal" convention).

-----

Correct.  The following is from the JavaBeans spec:

8.8 Capitalization of inferred names

When we use design patterns to infer a property name, we need to decide what
rules
to follow for capitalizing the inferred name. If we extract the name from
the middle of a normal mixedCase style Java name then the name will, by
default, begin with a capital letter.

Java programmers are accustomed to having normal identifiers start with
lower case letters.
Vigorous reviewer input has convinced us that we should follow this same
conventional rule
for property names.

Thus when we extract a property name from the middle of an existing Java
name, we normally
convert the first character to lower case. However to support the occasional
use of all upper-case names, we check if the first two characters of the
name are both upper case and if so leave it alone. So for example,

"FooBah" becomes "fooBah"
"Z" becomes "z"
"URL" becomes "URL"

----- Original Message -----
From: "emmanuel.boudrant" <b7...@yahoo.fr>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Monday, February 18, 2002 11:32 AM
Subject: BeanUtil BUG


>
> Hello,
>
> I've got a FormBean with property like this:
>
> private String nIdentifiant=null;
>
> public String getNIdentifiant(...
>
> public void setNIdentifiant(...
>
>
>
> private String nmClient=null;
>
> public String getNmClient(...
>
> public void setNmClient(...
>
>
>
> My action throw an exception ; no getter for property nIdentifiant....
>
> And when I make a BeanUtil.describe(myForm); I've got this output:
>
> [NIdentifiant=null ; nmClient = null ... ]
>
> NIdentifiant must be nIdentifiant !
>
>
>
> I'm under Struts1.0
>
>
>
> thank
>
> Emmanuel


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>