You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "Thakkar, Hetal" <he...@citigroup.com> on 2003/08/25 23:14:23 UTC

while constructs

I am trying to use while. But unfortunately, I could not find any example on Jelly's website. Could anyone let me know, how "while" constuct works in Jelly? 

I tried the following but it does not work:

<j:set var="iterations" value="${3}"/>	          	
<j:while test="${iterations} > 0">
	<j:set var="iterations" value="${iterations - 1 }"/>
	<log:info>${iterations}</log:info>
</j:while>

Thanks,
Hetal

Re: while constructs

Posted by Paul Libbrecht <pa...@activemath.org>.
Thakkar, Hetal wrote:
> I am trying to use while. But unfortunately, I could not find any example on Jelly's website. Could anyone let me know, how "while" constuct works in Jelly? 
> 
> I tried the following but it does not work:
> 
> <j:set var="iterations" value="${3}"/>	          	
> <j:while test="${iterations} > 0">
> 	<j:set var="iterations" value="${iterations - 1 }"/>
> 	<log:info>${iterations}</log:info>
> </j:while>

Hetal,

I would either use
  test="iterations > 0"

or
  test="${iterations > 0}"

but I think the first is correct...

Paul