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

WhenTagSupport

public abstract class WhenTagSupport extends javax.servlet.jsp.jstl.core.ConditionalTagSupport

WhenTagSupport is an abstract class that facilitates implementation of <when>-style tags in both the rtexprvalue and expression-evaluating libraries. It also supports <otherwise>.

In particular, this base class does the following:

  • overrides ConditionalTagSupport.doStartTag() to implement the appropriate semantics of subtags of <choose>
author
Shawn Bayern

Fields Summary
Constructors Summary
Methods Summary
public intdoStartTag()


        Tag parent;

        // make sure we're contained properly
        if (!((parent = getParent()) instanceof ChooseTag))
            throw new JspTagException(
		Resources.getMessage("WHEN_OUTSIDE_CHOOSE"));

        // make sure our parent wants us to continue
        if (!((ChooseTag) parent).gainPermission())
            return SKIP_BODY;                   // we've been reeled in

        // handle conditional behavior
        if (condition()) {
            ((ChooseTag) parent).subtagSucceeded();
            return EVAL_BODY_INCLUDE;
        } else
            return SKIP_BODY;