Hi Dante,

Thanks for the answer. The explanation is clear and the suggestion to refer
to the property on the jsp as "ACompanyId" works, but I think the check for
(upper/lower)case should not be on the first two letters, but on the
complete string.

Remke Rutgers

> -----Oorspronkelijk bericht-----
> Van: Dante Briones [mailto:[EMAIL PROTECTED]]
> Verzonden: Monday, April 22, 2002 19:16
> Aan: Struts Users Mailing List
> Onderwerp: Re: Problem with property in ActionForm
> 
> 
> This is a feature of the JavaBeans property naming standards 
> that allows 
> you to have an all-caps property name.  To quote from the JavaBeans 
> specification:
> --
> 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 and event names.
> 
> Thus when we extract a property or event 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"
> --
> 
> So you would have to refer to the property on the jsp as 
> "ACompanyId" in 
> order to use the property as coded below.  Or you could 
> rename the property 
> something like "AdminCompanyId".
> 
> HTH,
> 
> db
> 
> 
> At 04:54 PM 22/4/2002 +0200, you wrote:
> 
> >Hi all,
> >
> >I seem to have found a strange bug in Struts (or I need more coffee).
> >
> >I have an ActionForm with a property "aCompanyId" (the 'a' stands for
> >admin), and thus have the following members:
> >public Integer aCompanyId;
> >public Integer getACompanyId();
> >public void setACompanyId( Integer someId );
> >
> >But, when I try to reference this form in a .jsp using
> >, I get the following error: javax.servlet.ServletException: 
> No getter 
> >method for property aCompanyId of bean 
> org.apache.struts.taglib.html.BEAN 
> >The strange part is that if I change the name of the 
> property and the form 
> >methods to "aaCompanyId" and "getAaCompanyId()" etc it 
> *does* work. What's 
> >wrong here? Greetings, Arjan Lamers 
> >--------------------------------------------- Notice: The 
> only person 
> >getting his work done by Friday was Robinson Crusoe. -- To 
> unsubscribe, 
> >e-mail: For additional commands, e-mail:
> 
> 
> --
> To unsubscribe, e-mail:   
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to