FileDocCategorySizeDatePackage
OddTag.javaAPI DocGlassfish v2 API3038Sat May 05 19:17:12 BST 2007org.apache.taglibs.standard.examples.taglib

OddTag

public class OddTag extends javax.servlet.jsp.tagext.TagSupport

Tag handler for <odd>

author
Pierre Delisle
version
$Revision: 1.3 $ $Date: 2007/05/06 02:17:12 $

Fields Summary
Constructors Summary
Methods Summary
public intdoStartTag()

        LoopTag iteratorTag = (LoopTag)findAncestorWithClass(
                this, LoopTag.class);
        if (iteratorTag == null) {
            throw new JspTagException("<odd> must be nested within a LoopTag");
        }
        
        int count = iteratorTag.getLoopStatus().getCount();
        System.out.println("count: " + count);
                System.out.println("count odd/even: " + (count % 2));
        return (count % 2 == 1) ? EVAL_BODY_INCLUDE : SKIP_BODY;