FileDocCategorySizeDatePackage
ChooseTag.javaAPI DocGlassfish v2 API4467Sat May 05 19:17:52 BST 2007org.apache.taglibs.standard.tag.common.core

ChooseTag

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

Tag handler for <choose> in JSTL.

<choose> is a very simple tag that acts primarily as a container; it always includes its body and allows exactly one of its child <when> tags to run. Since this tag handler doesn't have any attributes, it is common.core to both the rtexprvalue and expression- evaluating versions of the JSTL library.

author
Shawn Bayern

Fields Summary
private boolean
subtagGateClosed
Constructors Summary
public ChooseTag()

        super();
        init();
    
Methods Summary
public intdoStartTag()

        subtagGateClosed = false;	// when we start, no children have run
        return EVAL_BODY_INCLUDE;
    
public synchronized booleangainPermission()
Returns status indicating whether a subtag should run or not.

return
true if the subtag should evaluate its condition and decide whether to run, false otherwise.

        return (!subtagGateClosed);
    
private voidinit()

        subtagGateClosed = false;                          // reset flag
    
public voidrelease()

        super.release();
        init();
    
public synchronized voidsubtagSucceeded()
Called by a subtag to indicate that it plans to evaluate its body.

        if (subtagGateClosed)
            throw new IllegalStateException(
		Resources.getMessage("CHOOSE_EXCLUSIVITY"));
        subtagGateClosed = true;