code: @Override
      public int doStartTag() throws JspException {
  
          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;
          }
      }
docs: /*
  Includes its body if condition() evalutes to true AND its parent
  ChooseTag wants it to do so.  The condition will not even be
  evaluated if ChooseTag instructs us not to run.