javax.servlet.jsp.tagext

Class TagSupport

Implemented Interfaces:
Serializable, Tag
Known Direct Subclasses:
BodyTagSupport

public class TagSupport
extends java.lang.Object
implements Tag, Serializable

Actions in a Tag Library are defined through subclasses of Tag.

Field Summary

protected String
id
protected PageContext
pageContext

Fields inherited from interface javax.servlet.jsp.tagext.Tag

EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE

Constructor Summary

TagSupport()
Default constructor, all subclasses are required to only define a public constructor with the same signature, and to call the superclass constructor.

Method Summary

int
doEndTag()
Process the end tag.
int
doStartTag()
Process the start tag for this instance.
static Tag
findAncestorWithClass(Tag from, Class klass)
Find the instance of a given class type that is closest to a given instance.
String
getId()
The value of the id attribute of this tag; or null.
Tag
getParent()
The Tag instance enclosing this tag instance.
Object
getValue(String k)
Get a value
Enumeration
getValues()
Enumerate the values
void
release()
release() called after doEndTag() to reset state
void
removeValue(String k)
Remove a value
void
setId(String id)
Set the id attribute
void
setPageContext(PageContext pageContext)
set the page context
void
setParent(Tag t)
Set the nesting tag of this tag.
void
setValue(String k, Object o)
Set a value

Field Details

id

protected String id


pageContext

protected PageContext pageContext

Constructor Details

TagSupport

public TagSupport()
Default constructor, all subclasses are required to only define a public constructor with the same signature, and to call the superclass constructor. This constructor is called by the code generated by the JSP translator.

Parameters:

Method Details

doEndTag

public int doEndTag()
            throws JspException
Process the end tag. This method will be called on all Tag objects. All instance state associated with this instance must be reset.
Specified by:
doEndTag in interface Tag


doStartTag

public int doStartTag()
            throws JspException
Process the start tag for this instance. The doStartTag() method assumes that all setter methods have been invoked before. When this method is invoked, the body has not yet been invoked.
Specified by:
doStartTag in interface Tag


findAncestorWithClass

public static final Tag findAncestorWithClass(Tag from,
                                              Class klass)
Find the instance of a given class type that is closest to a given instance. This class is used for coordination among cooperating tags.

Parameters:

Returns:
the nearest ancestor that implements the interface or is an instance of the class specified


getId

public String getId()
The value of the id attribute of this tag; or null.

Returns:
the value of the id attribute, or null


getParent

public Tag getParent()
The Tag instance enclosing this tag instance.
Specified by:
getParent in interface Tag

Returns:
the parent tag instance or null


getValue

public Object getValue(String k)
Get a value


getValues

public Enumeration getValues()
Enumerate the values


release

public void release()
release() called after doEndTag() to reset state
Specified by:
release in interface Tag


removeValue

public void removeValue(String k)
Remove a value


setId

public void setId(String id)
Set the id attribute


setPageContext

public void setPageContext(PageContext pageContext)
set the page context
Specified by:
setPageContext in interface Tag


setParent

public void setParent(Tag t)
Set the nesting tag of this tag.
Specified by:
setParent in interface Tag


setValue

public void setValue(String k,
                     Object o)
Set a value


Copyright © 1999-2000 The Apache Software Foundation. All Rights Reserved.