Try running:

java.beans.Introspector.decapitalize("LName")

The gory bean details can be found at:

http://java.sun.com/products/javabeans/docs/spec.html

Quoting Wes Rood <[EMAIL PROTECTED]>:

> Could you point me to more information on this behavior?
> 
> I'm still confused as to why it will capitailze the "f" in "fax" to 
> locate the getFax() method, but it will not capitalize the "l" in 
> "lName" to locate the getLName() method.
> 
> Thanks!
> 
> David Graham wrote:
> 
> >This is standard JavaBean behavior.  Regardless, I encourage you to use
> >lastName instead because lName is rather ugly and confusing.
> >
> >David
> >
> >--- Wes Rood <[EMAIL PROTECTED]> wrote:
> >  
> >
> >>I have an object as follows
> >>
> >>public class Contact {
> >>...
> >>    private String lName;  // the contact's last name
> >>    private String fax; // the contact's fax number
> >>...
> >>    public String getLName() {
> >>        return lName;
> >>    }
> >>
> >>    public String getFax() {
> >>        return fax;
> >>    }
> >>...
> >>}
> >>
> >>Then I use <nested:iterate> to go through a list of Contact objects and 
> >>attempt to access the lName and the fax attributes.  I observe the 
> >>following behavior:
> >>
> >><nested:write property="fax" />   correctly displays the value of the 
> >>"fax" attribute
> >>while:
> >><nested:write property="Fax" />   causes 
> >>org.apache.jasper.JasperException: No getter method for property 
> >>contacts[0].Fax of bean ...
> >>
> >>Apparently it is uppercasing the "f" in "fax" to call getFax(), but when
> >>
> >>the "F" is already in caps, it doesn't see the attribute.  This is fine,
> >>
> >>but then I tried accessing the "lName" property:
> >>
> >><nested:write property="lName"/>  causes 
> >>org.apache.jasper.JasperException: No getter method for property 
> >>contacts[0].lName of bean ...
> >>while:
> >><nested:write property="LName" /> correctly displays the value of the 
> >>"lName" attribute
> >>
> >>I also rewrote the jsp logic using <logic:iterate> and <bean:write> and 
> >>the same thing happened.
> >>
> >>What is going on here?  It appears that the "N" in the lName property is
> >>
> >>affecting how the "L" is handled.  Any ideas?

-- 
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech       <http://www.dotech.com/>

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

Reply via email to