@Override public void doTag() throws JspException { JspTag parent = getParent(); if (!(parent instanceof IfElseTag)) { throw new JspException("Parent IfElse tag is required", null); } IfElseTag ifTag = (IfElseTag) parent; if (ifTag.getTestValue()) { TagUtil.invokeBody(getJspBody()); } } }