|
Java EE 5 SDK 深圳电信培训中心.徐海蛟老师. |
||||||||
上一个类 下一个类 | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造器 | 方法 | 详细信息: 字段 | 构造器 | 方法 |
javax.servlet.jsp.tagext Class SimpleTagSupport
java.lang.Object javax.servlet.jsp.tagext.SimpleTagSupport
A base class for defining tag handlers implementing SimpleTag.
The SimpleTagSupport class is a utility class intended to be used as the base class for new simple tag handlers. The SimpleTagSupport class implements the SimpleTag interface and adds additional convenience methods including getter methods for the properties in SimpleTag.
- 从以下版本开始:
- JSP 2.0
构造器摘要 | |
---|---|
SimpleTagSupport()
Sole constructor. |
方法摘要 | |
---|---|
void |
doTag()
Default processing of the tag does nothing. |
static JspTag |
findAncestorWithClass(JspTag from,
Class<?> klass)
Find the instance of a given class type that is closest to a given instance. |
protected JspFragment |
getJspBody()
Returns the body passed in by the container via setJspBody. |
protected JspContext |
getJspContext()
Returns the page context passed in by the container via setJspContext. |
JspTag |
getParent()
Returns the parent of this tag, for collaboration purposes. |
void |
setJspBody(JspFragment jspBody)
Stores the provided JspFragment. |
void |
setJspContext(JspContext pc)
Stores the provided JSP context in the private jspContext field. |
void |
setParent(JspTag parent)
Sets the parent of this tag, for collaboration purposes. |
类方法继承 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
构造器详细信息 |
---|
SimpleTagSupport
public SimpleTagSupport()
- Sole constructor. (For invocation by subclass constructors,
typically implicit.)
方法详细信息 |
---|
doTag
public void doTag() throws JspException, IOException
- Default processing of the tag does nothing.
- 抛出异常:
JspException
- Subclasses can throw JspException to indicate an error occurred while processing this tag.SkipPageException
- If the page that (either directly or indirectly) invoked this tag is to cease evaluation. A Simple Tag Handler generated from a tag file must throw this exception if an invoked Classic Tag Handler returned SKIP_PAGE or if an invoked Simple Tag Handler threw SkipPageException or if an invoked Jsp Fragment threw a SkipPageException.IOException
- Subclasses can throw IOException if there was an error writing to the output stream- 另请参见:
SimpleTag.doTag()
setParent
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.
- 参数:
parent
- the tag that encloses this tag
getParent
public JspTag getParent()
- Returns the parent of this tag, for collaboration purposes.
- 返回:
- the parent of this tag
setJspContext
public void setJspContext(JspContext pc)
- Stores the provided JSP context in the private jspContext field.
Subclasses can access the
JspContext
viagetJspContext()
. - 规范说明:
setJspContext
in interfaceSimpleTag
- 参数:
pc
- the page context for this invocation- 另请参见:
SimpleTag.setJspContext(javax.servlet.jsp.JspContext)
getJspContext
protected JspContext getJspContext()
- Returns the page context passed in by the container via
setJspContext.
- 返回:
- the page context for this invocation
setJspBody
public void setJspBody(JspFragment jspBody)
- Stores the provided JspFragment.
- 规范说明:
setJspBody
in interfaceSimpleTag
- 参数:
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.- 另请参见:
SimpleTag.setJspBody(javax.servlet.jsp.tagext.JspFragment)
getJspBody
protected JspFragment getJspBody()
- Returns the body passed in by the container via setJspBody.
- 返回:
- the fragment encapsulating the body of this tag, or null if the action element is empty in the page.
findAncestorWithClass
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.
- 参数:
from
- The instance from where to start looking.klass
- The subclass of JspTag or interface to be matched- 返回:
- the nearest ancestor that implements the interface or is an instance of the class specified
|
Java EE 5 SDK 深圳电信培训中心.徐海蛟老师. |
||||||||
上一个类 下一个类 | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造器 | 方法 | 详细信息: 字段 | 构造器 | 方法 |
提交错误或意见
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。深圳电信培训中心.徐海蛟老师教学参考.