Hi Craig,

Yes I expected this to work as well, since the first letter is not
capitalized. Craig (T) provided some info from the spec, but this should
only apply if both the first and second letter are caps.  Not a big deal
really (just changed my property names), but something to be aware of...

Thanks,
Bob


-----Original Message-----
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 14, 2001 3:53 PM
To: [EMAIL PROTECTED]
Subject: Re: ActionForm property naming conventions


[EMAIL PROTECTED] wrote:

> My question is best asked with an example... Why is it that I am unable to
> create a property named "nTerminal" for my ActionForm/JSP? This problem
> occurs when there is an uppercase letter in the 2nd position of the
property
> name. If I change the name to "nterminal" or "ntErminal" then things work
> just fine. In other words- getNterminal() is recognized by Struts, but
> getNTerminal() is invalid and results in a runtime error in the html tag.
Is
> this a limitation imposed by Javabean conventions or is this a Struts
> specific issue? (If you think I am crazy, then perhaps this problem is
> specific to WebLogic.)
>
> Thanks,
> Bob

Struts uses the introspection capabilities Java Reflection APIs -- in
particular, it calls java.beans.Introspector.getBeanInfo() -- to figure out
the
names of the getter and setter methods for various properties.  The
introspector, in turn, enforces the design patterns that are documented in
the
JavaBeans specification.  It is possible that there are some special cases
for
the second letter of a property name being capitalized.

I would have expected "getNTerminal" and "setNTerminal" to work for a
property
named "nTerminal".

Craig

Reply via email to