You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Ben Pryor <BP...@widen.com> on 2005/08/25 22:58:41 UTC

Tapestry 4 property name capitalization

I'm seeing some behavior I don't understand with the way Tapestry 4
treats capitalization of property names. Below are some examples.  Each
example has an abstract accessor defined in a page class and a
<property> element in the page specification.
 
public abstract Object getOrder();
Works:        <property name="order" /> 
Exception:    <property name="Order" /> 
 
public abstract Object getSingleOrderType();
Works:        <property name="singleOrderType" /> 
Exception:    <property name="SingleOrderType" /> 
 
public abstract Object getAPropertyTest();
Works:        <property name="APropertyTest" /> 
Exception:    <property name="aPropertyTest" /> 
 
public abstract Object getAProperty();
Works:        <property name="AProperty" /> 
Exception:    <property name="aProperty" /> 
 
The discrepancy, in my mind, is that sometimes the property name needs
to start with an uppercase letter and sometimes not.  I am pretty sure
in Tapestry 3 the property name could always start with a lowercase
letter.
 
I don't want to generalize too much from my limited tests, but I'm
guessing that camel case names where the first section is only one
letter long are being treated differently.
 
Is this how property names are expected to work?
 
Thanks,
Ben

Re: Tapestry 4 property name capitalization

Posted by Howard Lewis Ship <hl...@gmail.com>.
Not only is it how its intended to work, it's exactly as the JavaBeans
specification dictates.

On 8/25/05, Ben Pryor <BP...@widen.com> wrote:
> I'm seeing some behavior I don't understand with the way Tapestry 4
> treats capitalization of property names. Below are some examples.  Each
> example has an abstract accessor defined in a page class and a
> <property> element in the page specification.
> 
> public abstract Object getOrder();
> Works:        <property name="order" />
> Exception:    <property name="Order" />
> 
> public abstract Object getSingleOrderType();
> Works:        <property name="singleOrderType" />
> Exception:    <property name="SingleOrderType" />
> 
> public abstract Object getAPropertyTest();
> Works:        <property name="APropertyTest" />
> Exception:    <property name="aPropertyTest" />
> 
> public abstract Object getAProperty();
> Works:        <property name="AProperty" />
> Exception:    <property name="aProperty" />
> 
> The discrepancy, in my mind, is that sometimes the property name needs
> to start with an uppercase letter and sometimes not.  I am pretty sure
> in Tapestry 3 the property name could always start with a lowercase
> letter.
> 
> I don't want to generalize too much from my limited tests, but I'm
> guessing that camel case names where the first section is only one
> letter long are being treated differently.
> 
> Is this how property names are expected to work?
> 
> Thanks,
> Ben
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org