cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurent Perez <>
Subject Concatenation of variables in JXTemplate
Date Wed, 01 Dec 2004 15:35:32 GMT

I have the following declarations in my jx template :

<jx:set var="b" value="bean"/>
<jx:set var="l" value="${lang}"/>

Now I would like to access a bean property using ${bean.l} (call it a
'dynamic property'). For example when l = "foo", I would like to
access ${}, but I don't understand how to evaluate the ${}
part :(

I've tried :

<jx:set var="b" value="bean"/>
<jx:set var="l" value="${lang}"/>
<jx:set var="dot" value="."/>
<jx:set var="both" value="${b.concat(dot).concat(l)}"/>

but whenever I access ${both}, I just get a string
"bean.value_of_lang", because evaluation failed.

Can anyone help me with the trick ?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message