Methods Summary |
---|
protected abstract boolean | condition()Subclasses implement this method to compute the boolean result
of the conditional action. This method is invoked once per tag invocation
by doStartTag().
|
public int | doStartTag()Includes its body if condition() evaluates to true.
// execute our condition() method once per invocation
result = condition();
// expose variables if appropriate
exposeVariables();
// handle conditional behavior
if (result)
return EVAL_BODY_INCLUDE;
else
return SKIP_BODY;
|
private void | exposeVariables()
if (var != null)
pageContext.setAttribute(var, Boolean.valueOf(result), scope);
|
private void | init()
result = false; // not really necessary
var = null;
scope = PageContext.PAGE_SCOPE;
|
public void | release()Releases any resources this ConditionalTagSupport may have (or inherit).
super.release();
init();
|
public void | setScope(java.lang.String scope)Sets the 'scope' attribute.
if (scope.equalsIgnoreCase("page"))
this.scope = PageContext.PAGE_SCOPE;
else if (scope.equalsIgnoreCase("request"))
this.scope = PageContext.REQUEST_SCOPE;
else if (scope.equalsIgnoreCase("session"))
this.scope = PageContext.SESSION_SCOPE;
else if (scope.equalsIgnoreCase("application"))
this.scope = PageContext.APPLICATION_SCOPE;
// TODO: Add error handling? Needs direction from spec.
|
public void | setVar(java.lang.String var)Sets the 'var' attribute.
this.var = var;
|