Subject: Re: Bug in struts-logic.tld - equal tag? From: "Scott Curtis" <[EMAIL PROTECTED]> === Nicolas
Thank you for that explanation. I figured it might be something to do with the JavaBean spec. I would be grateful if someone could point me to the part in the JavaBean spec that defines these rules so that when I ask the developers of the IDE I use to amend the getter generation function to conform to the correct rules, I can have backup and prevent a flame war about pointless requests to support user specific coding standards. :-) thanks - scott "Nicolas De Loof" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... > > I remember such an error reported on this list some weeks ago, the > explanation was that JavaBean spec defines some special behaviour with > upper-case properties. > > To build getter method names conforming to this behaviour, BeanUtil looks at > the two first charcacters of a property name and, if uppercases chars are > found, don't "upper-case" the first char : > aDTDFlag => getaDTDFlag() or isaDTDFlag() > > when you explicilty type ADTDFlag as property name in your JSP, the getter > method build becomes : > ADTDFlag => getADTDFlag() or isADTDFlag() and it works > > So, if this behaviour is define JavaBean spec (I'n not sure about this, can > someone confirm it ?), you could define getters "isaDTDFlag()" to conform to > it. > > Nico > > > > > > Subject: Bug in struts-logic.tld - equal tag? > > > From: "Scott Curtis" <[EMAIL PROTECTED]> > > > === > > > Hi, > > > > > > This is a difficult one to explain, so bare with me... > > > > > > I have a bean class (MyBean) with various getters/setters for the > > > propertiescontained within it. Two of which are: > > > > > > private boolean valid; > > > public boolean isValid() { return valid; } > > > > > > private boolean aDTDFlag; > > > public boolean isADTDFlag() { return aDTDFlag; } > > > > > > I then have a JSP using the struts-logic.tld tag library's equal > > > tag as > > > follows: > > > > > > <logic:equal name="mybean" property="valid" value="true"> > > > Do Something here! > > > </logic:equal> > > > > > > <logic:equal name="MyBean" property="aDTDFlag" value="true"> > > > Do Something here! > > > </logic:equal> > > > > > > When I load this page I get: > > > > > > javax.servlet.jsp.JspException: Exception accessing property > > > aDTDFlag for > > > bean MyBean: java.lang.NoSuchMethodException: Unknown property > > > 'aDTDFlag' > > > The only way to make it work is to reference the "aDTDFlag" > > > property as > > > "ADTDFlag" within the logic:equal tag - ie with an uppercase > > > 'a'?!? The > > > reference to the "valid" property is fine with a lowercase 'v'? > > > This isn't > > > working correctly because the property is named with a lowercase > > > 'a' and > > > references to it shouldn't be forced to use an uppercase 'a'. > > > > > > Am I correct? If so is this the right place to report this sort of > > > thing? > > > thanks > > > - scott > > > > > > > > > > > > > > > -- > > > To unsubscribe, e-mail: <')" >mailto:struts-user- > > > [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]> > > > > > > -- > > 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]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>