Name
TagAdapter
Synopsis
The TagAdapter
class makes it possible to nest classic
and simple tag handlers by working around a type mismatch between the
old and new tag handler APIs, namely the fact that the
setParent( )
method in the Tag
interface takes an instance of Tag
while the
SimpleTag
interface doesn’t
extend Tag
.
The container creates an instance of TagAdapter
to
wrap a SimpleTag
implementation when a simple tag
handler is the parent of a classic tag handler and uses the
TagAdapter
as the setParent( )
argument. The findAncestorWithClass( )
method in
SimpleTagSupport
knows how to deal with
TagAdapter
instances it may find in the parent
chain.
Synopsis
Class name: |
javax.servlet.jsp.tagext.TagAdapter |
Extends: |
None |
Implements: |
javax.servlet.jsp.tagext.Tag |
Implemented by: |
Internal container-dependent class; most containers use the reference implementation of the class (developed in the Apache Jakarta project) |
Constructor
-
public TagAdapter(SimpleTag adaptee)
Creates a new instance that wraps the given
SimpleTag
.
Methods
-
public int doEndTag( ) throws JspException
Never called by the container. Throws
UnsupportedOperationException
.-
public int doStartTag( ) throws JspException
Never called by the container. Throws
UnsupportedOperationException
.-
public JspTag getAdaptee( )
Returns the wrapped tag handler.
-
public Tag getParent( )
Returns the wrapped tag handler’s parent tag handler.
-
public void release( )
Never called by the container. Throws
UnsupportedOperationException
.-
public ...
Get JavaServer Pages, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.