Tag parent = getParent();
if (! (parent instanceof ChooseTag))
throw new JspException(L.l("x:when tag must be contained in a c:choose tag."));
ChooseTag chooseTag = (ChooseTag) parent;
if (chooseTag.isMatch())
return SKIP_BODY;
PageContextImpl pageContext = (PageContextImpl) this.pageContext;
Env env = XPath.createEnv();
env.setVarEnv(pageContext.getVarEnv());
Node node = pageContext.getNodeEnv();
boolean test = _select.evalBoolean(node, env);
env.free();
if (test) {
chooseTag.setMatch();
return EVAL_BODY_INCLUDE;
}
else
return SKIP_BODY;