Velocity 有没有办法在速度上打破foreach循环?

Velocity 有没有办法在速度上打破foreach循环?,velocity,Velocity,我通过使用foreach遍历(权限)集合来寻找特定的条件。所以,如果我找到了所有我需要的东西,不再需要循环,有没有办法打破循环?我对velocity还不熟悉,并试图摸索这种奇怪的语言 #foreach ($perm in $space.getPermissions()) #end 最新版本的Velocity(1.6)包含一条语句“break” 速度不会提供“中断”,但也有方法可以做到这一点: ## list first 5 customers only #foreach( $custom

我通过使用foreach遍历(权限)集合来寻找特定的条件。所以,如果我找到了所有我需要的东西,不再需要循环,有没有办法打破循环?我对velocity还不熟悉,并试图摸索这种奇怪的语言

#foreach ($perm in $space.getPermissions())  
#end

最新版本的Velocity(1.6)包含一条语句“break”

速度不会提供“中断”,但也有方法可以做到这一点:
## list first 5 customers only
#foreach( $customer in $customerList )
    #if( $velocityCount > 5 )
        #break
    #end
    $customer.Name
#end