Hi, [Attached BreakTag.java]
BreakTag [ <break if="condition"/> ] tag allows one to conditionally break out of a script block without executing any subsequent scripts within its parent . The natural use is to break out of a <foreach/> , <while/> loop . Break works in the context of any parent tag and thus one can use to conditionaly break out of the entire script itself. [ testBreak.jelly attached ] Regards, Vinay. Patch to CoreTagLibrary ------------------------ 97a98 > registerTag("break",BreakTag.class); __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com
BreakTag.java
Description: BreakTag.java
<?xml version="1.0"?> <!-- displays the current command line arguments --> <j:jelly xmlns:j="jelly:core"> <!-- Setting a boolean var to true --> <j:set var="exitCompletely" value="true"/> <arguments> <j:forEach var="arg" items="${args}" begin="1"> <!-- Break cond for the foreach loop --> <j:break if='${arg=="three"}'/> <argument>${arg}</argument> </j:forEach> </arguments> <j:break if='${exitCompletely}'/> ************************** These Should NOT appear ************************** </j:jelly>
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>