You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Bogdan Mocanu <bo...@gmail.com> on 2009/11/13 16:37:44 UTC

[Fwd: Re: $velocityHasNext always returning false (Velocity 1.6.2)]

Hello,

I noticed a space between the name of the property and the value. Try to 
remove that, just to eliminate this from the possible causes. So instead 
of having this in your velocity.properties:

directive.foreach.iterator.name = velocityHasNext

put this:

directive.foreach.iterator.name=velocityHasNext

You could also remove the property completely, since "velocityHasNext" 
is the default name. Please try this, and see if you get any results.

Regards,
Bogdan

mjparme wrote:
> It appears that $velocityHasNext is always returning false.
>
> I have this in my template:
>
> #foreach(${column} in
> ${columns})${column.columnName}#if(${velocityHasNext}),#end#end
>
> The comma is never printed. However, if I change the condition to something
> that is definitely true the comma printed, i.e.:
>
> #foreach(${column} in ${columns})${column.columnName}#if(1 >0),#end#end
>
> I have this property in velocity.properties:
>
> directive.foreach.iterator.name = velocityHasNext
>
> I just want to make sure I am not doing something stupid/obviously wrong
> before opening an issue.
>
> Can anyone provide insight?
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org