FileDocCategorySizeDatePackage
SetTag.javaAPI DocGlassfish v2 API4436Sat May 05 19:17:54 BST 2007org.apache.taglibs.standard.tag.common.xml

SetTag

public class SetTag extends javax.servlet.jsp.tagext.TagSupport

Tag handler for <set> in JSTL's XML library.

author
Shawn Bayern

Fields Summary
private String
select
private String
var
private int
scope
Constructors Summary
public SetTag()
Constructs a new handler. As with TagSupport, subclasses should not provide other constructors and are expected to call the superclass constructor.

        super();
        init();
    
Methods Summary
public intdoStartTag()

        // process the query
        XPathUtil xu = new XPathUtil(pageContext);
        List result =
        xu.selectNodes(XPathUtil.getContext(this), select);
        Object ret = result;
        
        // unwrap primitive types if that's what we received
        if (result.size() == 1) {
            Object o = result.get(0);
            if (o instanceof String || o instanceof Boolean
            || o instanceof Number)
                ret = o;
        }
        
        // expose the final result
        pageContext.setAttribute(var, ret, scope);
        return SKIP_BODY;
    
private voidinit()

	var = null;
	select = null;
        scope = PageContext.PAGE_SCOPE;
    
public voidrelease()

        super.release();
        init();
    
public voidsetScope(java.lang.String scope)

	this.scope = Util.getScope(scope);
    
public voidsetSelect(java.lang.String select)

	this.select = select;
    
public voidsetVar(java.lang.String var)

	this.var = var;