Package javax.servlet.jsp.tagext
Class TagSupport
- java.lang.Object
-
- javax.servlet.jsp.tagext.TagSupport
-
- All Implemented Interfaces:
java.io.Serializable,Tag
- Direct Known Subclasses:
BodyTagSupport
public class TagSupport extends java.lang.Object implements Tag, java.io.Serializable
Actions in a Tag Library are defined through subclasses of Tag.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Stringidprotected PageContextpageContext-
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
-
-
Constructor Summary
Constructors Constructor Description 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intdoEndTag()Process the end tag.intdoStartTag()Process the start tag for this instance.static TagfindAncestorWithClass(Tag from, java.lang.Class klass)Find the instance of a given class type that is closest to a given instance.java.lang.StringgetId()The value of the id attribute of this tag; or null.TaggetParent()The Tag instance enclosing this tag instance.java.lang.ObjectgetValue(java.lang.String k)Get a valuejava.util.EnumerationgetValues()Enumerate the valuesvoidrelease()release() called after doEndTag() to reset statevoidremoveValue(java.lang.String k)Remove a valuevoidsetId(java.lang.String id)Set the id attributevoidsetPageContext(PageContext pageContext)set the page contextvoidsetParent(Tag t)Set the nesting tag of this tag.voidsetValue(java.lang.String k, java.lang.Object o)Set a value
-
-
-
Field Detail
-
id
protected java.lang.String id
-
pageContext
protected PageContext pageContext
-
-
Constructor Detail
-
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:
libraryPrefix- The namespace prefix used for this library. For example "jsp:".tagName- The name of the element or yag, for example "useBean"
-
-
Method Detail
-
findAncestorWithClass
public static final Tag findAncestorWithClass(Tag from, java.lang.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:
the- subclass of Tag or interface to be matched- Returns:
- the nearest ancestor that implements the interface or is an instance of the class specified
-
doStartTag
public int doStartTag() throws JspExceptionProcess 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:
doStartTagin interfaceTag- Throws:
JspException- See Also:
BodyTag
-
doEndTag
public int doEndTag() throws JspExceptionProcess the end tag. This method will be called on all Tag objects. All instance state associated with this instance must be reset.- Specified by:
doEndTagin interfaceTag- Throws:
JspException
-
release
public void release()
release() called after doEndTag() to reset state
-
setParent
public void setParent(Tag t)
Set the nesting tag of this tag.
-
getParent
public Tag getParent()
The Tag instance enclosing this tag instance.
-
setId
public void setId(java.lang.String id)
Set the id attribute
-
getId
public java.lang.String getId()
The value of the id attribute of this tag; or null.- Returns:
- the value of the id attribute, or null
-
setPageContext
public void setPageContext(PageContext pageContext)
set the page context- Specified by:
setPageContextin interfaceTag
-
setValue
public void setValue(java.lang.String k, java.lang.Object o)Set a value
-
getValue
public java.lang.Object getValue(java.lang.String k)
Get a value
-
removeValue
public void removeValue(java.lang.String k)
Remove a value
-
getValues
public java.util.Enumeration getValues()
Enumerate the values
-
-