commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james_strac...@yahoo.co.uk>
Subject Re: [jelly] question
Date Wed, 22 Jan 2003 16:58:54 GMT
> Hi,
>
> can someone tell me why in the following script,
>
> <j:jelly xmlns:j="jelly:core">
>
>      <j:set var="repeat-count" value="5"/>
>      <j:set var="select_name" value="selectedLocale"/>
>
>      <j:out value="repeat-count=${repeat-count}"/>
>      <j:out value="select_name=${select_name}"/>
>
> </j:jelly>
>
> the output is "0" for the first variable, and "selectedLocale" for the
> second? In particular, why does the expression ${repeat-count} yield a
> result of Integer(0)?

- is interpreted by the expression language as numerical subtraction.

e.g.

${foo- 12}

BTW you don't need to use <j:out>, its only there for JSTL support. So you
can do

<j:jelly xmlns:j="jelly:core">

     <j:set var="repeat_count" value="5"/>
     <j:set var="select_name" value="selectedLocale"/>

     repeat count=${repeat_count}
     select_name=${select_name}

</j:jelly>

James
-------
http://radio.weblogs.com/0112098/

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

Mime
View raw message