You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Peter Stavrinides <p....@albourne.com> on 2007/10/31 14:18:53 UTC

Expression syntax Tapestry 5

Hi all

Can anyone point me to some documentation on writing expressions in 
tapestry templates. I am looking for some examples of  operators and 
general syntax.

Thanks
Peter

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


Re: Expression syntax Tapestry 5

Posted by Nick Westgate <ni...@key-planning.co.jp>.
Details of prop are here:
http://tapestry.apache.org/tapestry5/tapestry-core/guide/parameters.html

Cheers,
Nick.


Peter Stavrinides wrote:
> Thanks Chris, that helps answer my question.
> Peter
> 
> Chris Lewis wrote:
>> I could be mistaken, but I think you'll find the "language", if you 
>> can call it that, pleasantly dumb compared to OGNL. Let me disclaim 
>> once more - you should consult the docs - but I don't believe there 
>> are any operators at all. In templates you simply have 3 constructs:
>>
>> 1) Expansions. These are similar to what you find in ant (and maven?), 
>> where expressions with in ${} are resolved depending on the binding 
>> prefix.
>> 2) Binding prefixes. Things like "prop:" and "message:" instruct T5 to 
>> either attempt to resolve a property or a message. There are several 
>> default prefixes and you can write your own. If you saw fit to have 
>> operators of some sort, my guess is you'd need to write a binding 
>> prefix for it (see docs).
>> 3) Property access. The default prefix for component parameters is 
>> "prop:". Properties are resolved from the containing page or 
>> component, and are expressed as: object.property. Say you want to 
>> print the email of the logged in user; your page contains a property 
>> "user" that in turn has a property "email". T5 uses bean naming 
>> conventions, so your page must provide access to the "user" property 
>> via a method getUser(). For it to resolve the "email" property on the 
>> user object, the user object must have a method getEmail().
>>
>> hope that helps.
>>
>> chris
>>
>> Peter Stavrinides wrote:
>>> Hi all
>>>
>>> Can anyone point me to some documentation on writing expressions in 
>>> tapestry templates. I am looking for some examples of  operators and 
>>> general syntax.
>>>
>>> Thanks
>>> Peter
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 

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


Re: Expression syntax Tapestry 5

Posted by Peter Stavrinides <p....@albourne.com>.
Thanks Chris, that helps answer my question.
Peter

Chris Lewis wrote:
> I could be mistaken, but I think you'll find the "language", if you 
> can call it that, pleasantly dumb compared to OGNL. Let me disclaim 
> once more - you should consult the docs - but I don't believe there 
> are any operators at all. In templates you simply have 3 constructs:
>
> 1) Expansions. These are similar to what you find in ant (and maven?), 
> where expressions with in ${} are resolved depending on the binding 
> prefix.
> 2) Binding prefixes. Things like "prop:" and "message:" instruct T5 to 
> either attempt to resolve a property or a message. There are several 
> default prefixes and you can write your own. If you saw fit to have 
> operators of some sort, my guess is you'd need to write a binding 
> prefix for it (see docs).
> 3) Property access. The default prefix for component parameters is 
> "prop:". Properties are resolved from the containing page or 
> component, and are expressed as: object.property. Say you want to 
> print the email of the logged in user; your page contains a property 
> "user" that in turn has a property "email". T5 uses bean naming 
> conventions, so your page must provide access to the "user" property 
> via a method getUser(). For it to resolve the "email" property on the 
> user object, the user object must have a method getEmail().
>
> hope that helps.
>
> chris
>
> Peter Stavrinides wrote:
>> Hi all
>>
>> Can anyone point me to some documentation on writing expressions in 
>> tapestry templates. I am looking for some examples of  operators and 
>> general syntax.
>>
>> Thanks
>> Peter
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>


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


Re: Expression syntax Tapestry 5

Posted by Chris Lewis <ch...@bellsouth.net>.
I could be mistaken, but I think you'll find the "language", if you can 
call it that, pleasantly dumb compared to OGNL. Let me disclaim once 
more - you should consult the docs - but I don't believe there are any 
operators at all. In templates you simply have 3 constructs:

1) Expansions. These are similar to what you find in ant (and maven?), 
where expressions with in ${} are resolved depending on the binding prefix.
2) Binding prefixes. Things like "prop:" and "message:" instruct T5 to 
either attempt to resolve a property or a message. There are several 
default prefixes and you can write your own. If you saw fit to have 
operators of some sort, my guess is you'd need to write a binding prefix 
for it (see docs).
3) Property access. The default prefix for component parameters is 
"prop:". Properties are resolved from the containing page or component, 
and are expressed as: object.property. Say you want to print the email 
of the logged in user; your page contains a property "user" that in turn 
has a property "email". T5 uses bean naming conventions, so your page 
must provide access to the "user" property via a method getUser(). For 
it to resolve the "email" property on the user object, the user object 
must have a method getEmail().

hope that helps.

chris

Peter Stavrinides wrote:
> Hi all
>
> Can anyone point me to some documentation on writing expressions in 
> tapestry templates. I am looking for some examples of  operators and 
> general syntax.
>
> Thanks
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


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