Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
javax.servlet.jsp.tagext.SimpleTagSupport
Constructor Summary | |
|
Method Summary | |
void |
|
static JspTag |
|
protected JspFragment |
|
protected JspContext |
|
JspTag |
|
void |
|
void |
|
void |
public SimpleTagSupport()
Sole constructor. (For invocation by subclass constructors, typically implicit.)
public void doTag() throws JspException, IOException
Default processing of the tag does nothing.
- Throws:
JspException
- Subclasses can throw JspException to indicate an error occurred while processing this tag.
- See Also:
SimpleTag.doTag()
public static final JspTag findAncestorWithClass(JspTag from, Class klass)
Find the instance of a given class type that is closest to a given instance. This method uses the getParent method from the Tag and/or SimpleTag interfaces. This method is used for coordination among cooperating tags. For every instance of TagAdapter encountered while traversing the ancestors, the tag handler returned by TagAdapter.getAdaptee() - instead of the TagAdpater itself - is compared to klass. If the tag handler matches, it - and not its TagAdapter - is returned. The current version of the specification only provides one formal way of indicating the observable type of a tag handler: its tag handler implementation class, described in the tag-class subelement of the tag element. This is extended in an informal manner by allowing the tag library author to indicate in the description subelement an observable type. The type should be a subtype of the tag handler implementation class or void. This addititional constraint can be exploited by a specialized container that knows about that specific tag library, as in the case of the JSP standard tag library. When a tag library author provides information on the observable type of a tag handler, client programmatic code should adhere to that constraint. Specifically, the Class passed to findAncestorWithClass should be a subtype of the observable type.
- Parameters:
from
- The instance from where to start looking.klass
- The subclass of JspTag or interface to be matched
- Returns:
- the nearest ancestor that implements the interface or is an instance of the class specified
protected JspFragment getJspBody()
Returns the body passed in by the container via setJspBody.
- Returns:
- the fragment encapsulating the body of this tag, or null if the action element is empty in the page.
protected JspContext getJspContext()
Returns the page context passed in by the container via setJspContext.
- Returns:
- the page context for this invocation
public JspTag getParent()
Returns the parent of this tag, for collaboration purposes.
- Returns:
- the parent of this tag
public void setJspBody(JspFragment jspBody)
Stores the provided JspFragment.
- Specified by:
- setJspBody in interface SimpleTag
- Parameters:
jspBody
- The fragment encapsulating the body of this tag. If the action element is empty in the page, this method is not called at all.
- See Also:
SimpleTag.setJspBody(JspFragment)
public void setJspContext(JspContext pc)
Stores the provided JSP context in the private jspContext field. Subclasses can access theJspContext
viagetJspContext()
.
- Specified by:
- setJspContext in interface SimpleTag
- Parameters:
pc
- the page context for this invocation
- See Also:
SimpleTag.setJspContext(JspContext)
public void setParent(JspTag parent)
Sets the parent of this tag, for collaboration purposes. The container invokes this method only if this tag invocation is nested within another tag invocation.
- Parameters:
parent
- the tag that encloses this tag