FileDocCategorySizeDatePackage
If.javaAPI DocGlassfish v2 API3101Fri May 04 22:32:58 BST 2007org.apache.jasper.tagplugins.jstl

If

public final class If extends Object implements TagPlugin

Fields Summary
Constructors Summary
Methods Summary
public voiddoTag(TagPluginContext ctxt)

	String condV = ctxt.getTemporaryVariableName();
	ctxt.generateJavaSource("boolean " + condV + "=");
	ctxt.generateAttribute("test");
	ctxt.generateJavaSource(";");
	if (ctxt.isAttributeSpecified("var")) {
	    String scope = "PageContext.PAGE_SCOPE";
	    if (ctxt.isAttributeSpecified("scope")) {
		String scopeStr = ctxt.getConstantAttribute("scope");
		if ("request".equals(scopeStr)) {
		    scope = "PageContext.REQUEST_SCOPE";
		} else if ("session".equals(scopeStr)) {
		    scope = "PageContext.SESSION_SCOPE";
		} else if ("application".equals(scopeStr)) {
		    scope = "PageContext.APPLICATION_SCOPE";
		}
	    }
	    ctxt.generateJavaSource("_jspx_page_context.setAttribute(");
	    ctxt.generateAttribute("var");
	    ctxt.generateJavaSource(", new Boolean(" + condV + ")," + scope + ");");
	}
	ctxt.generateJavaSource("if (" + condV + "){");
	ctxt.generateBody();
	ctxt.generateJavaSource("}");