Premier
Premier

Reputation: 4228

Apache Velocity foreach loop #continue

Is there a #continue command for jump to next iteration in foreach loop?

Upvotes: 26

Views: 13663

Answers (2)

Woodchuck
Woodchuck

Reputation: 4414

Based on the documentation, Apache Velocity does not appear to have a #continue function for its foreach loop.

In case it might help, it does have a foreach break directive, added in 2008.

Upvotes: 7

Mike K.
Mike K.

Reputation: 3789

I have a bunch of velocity code but I don't think I've ever seen this. I believe you have to use a #foreach and then use and #if to check your skip condition within the loop. The VTL guide doesn't seem have a better approach.

Upvotes: 17

Related Questions