JSP学习笔记6
2008-05-15 09:59
274 查看
Custom Tag Library
Simple Tag
javax.servlet.jsp.tagext.SimpleTag接口提供以下方法:
setJspContext() Makes the JspContext available for tag processing
setParent() Called by the web container to make the parent tag available
setJspBody() Makes the body content available for tag processing
doTag() Called by the container to begin SimpleTag operation
getParent() Called by the Java class to obtain its parent JspTag
javax.servlet.jsp.tagext.SimpleTagSupport类别implements SimpleTag 所有方法,并提供以下方法:
getJspContext() Returns the JspContext for processing in the tag
getJspBody() Returns the JspFragment object for body processing in the tag
findAncestorWithClass() Returns the ancestor tag with the specified class
javax.servlet.jsp.tagext.Tag接口提供以下方法:
void setPageContext(PageContext pc)
void setParent(Tag t)
Tag getParent()
int doStartTag() throws JspException
int doEndTag() throws JspException
void release()
javax.servlet.jsp.tagext.IterationTag接口extends Tag提供以下方法:
int doAfterBody() throws JspException
javax.servlet.jsp.tagext.BodyTag接口extends IterationTag提供以下方法:
void setBodyContent(BodyContent bc)
void doInitBody() throws JspException
javax.servlet.jsp.tagext.TagSupport类别implements IterationTag提供以下方法:
static Tag findAncestorWithClass(Tag from , java.lang.Class class)
javax.servlet.jsp.tagext.BodyTagSupport类别extends TagSupport implements BodyTag提供以下方法:
JspWriter getPreviousOut()
BodyContent getBodyContent()
===========================================================================
标签类库描述文件(Tag Library Descriptor简称TLD)
在<taglib>元素定义标签类库相关信息,其子元素如下:
<tlib-version>标签库版本</tlib-version>
<jsp-version>JSP版本</jsp-version>
<short-name>定义一个简短的名称</short-name>
<uri>标签库所对应的URI信息</uri>
<tag>标签库所包含的自订标签,可定义多个
<name>自订标签名称</name>
<tag-class>自订标签所对应的Tag Handler Class</tag-class>
<body-content>标签主体的种类 empty , JSP , tagdependent , scriptless</body-content>
<description>说明</description>
<attribute>定义属性,可定义多个
<name>属性名称</name>
<type>属性类型</type>
<required>此属性是否为必要(true/false)</required>
<rtexprvalue>属性值是否可以在JSP执行时期动态产生(true/false)</rtexprvalue>
</attribute>
</tag>
Simple Tag
javax.servlet.jsp.tagext.SimpleTag接口提供以下方法:
setJspContext() Makes the JspContext available for tag processing
setParent() Called by the web container to make the parent tag available
setJspBody() Makes the body content available for tag processing
doTag() Called by the container to begin SimpleTag operation
getParent() Called by the Java class to obtain its parent JspTag
javax.servlet.jsp.tagext.SimpleTagSupport类别implements SimpleTag 所有方法,并提供以下方法:
getJspContext() Returns the JspContext for processing in the tag
getJspBody() Returns the JspFragment object for body processing in the tag
findAncestorWithClass() Returns the ancestor tag with the specified class
javax.servlet.jsp.tagext.Tag接口提供以下方法:
void setPageContext(PageContext pc)
void setParent(Tag t)
Tag getParent()
int doStartTag() throws JspException
int doEndTag() throws JspException
void release()
javax.servlet.jsp.tagext.IterationTag接口extends Tag提供以下方法:
int doAfterBody() throws JspException
javax.servlet.jsp.tagext.BodyTag接口extends IterationTag提供以下方法:
void setBodyContent(BodyContent bc)
void doInitBody() throws JspException
javax.servlet.jsp.tagext.TagSupport类别implements IterationTag提供以下方法:
static Tag findAncestorWithClass(Tag from , java.lang.Class class)
javax.servlet.jsp.tagext.BodyTagSupport类别extends TagSupport implements BodyTag提供以下方法:
JspWriter getPreviousOut()
BodyContent getBodyContent()
===========================================================================
标签类库描述文件(Tag Library Descriptor简称TLD)
在<taglib>元素定义标签类库相关信息,其子元素如下:
<tlib-version>标签库版本</tlib-version>
<jsp-version>JSP版本</jsp-version>
<short-name>定义一个简短的名称</short-name>
<uri>标签库所对应的URI信息</uri>
<tag>标签库所包含的自订标签,可定义多个
<name>自订标签名称</name>
<tag-class>自订标签所对应的Tag Handler Class</tag-class>
<body-content>标签主体的种类 empty , JSP , tagdependent , scriptless</body-content>
<description>说明</description>
<attribute>定义属性,可定义多个
<name>属性名称</name>
<type>属性类型</type>
<required>此属性是否为必要(true/false)</required>
<rtexprvalue>属性值是否可以在JSP执行时期动态产生(true/false)</rtexprvalue>
</attribute>
</tag>
相关文章推荐
- jsp servlet 学习笔记概要--from《圣思园视频》
- Servlet与Jsp学习笔记--8、JSTL
- Java for Web学习笔记(十四):JSP(4)JSP Tag
- Java Web学习笔记之JSP基础
- JSP学习笔记1:JSP生命周期
- JSP内置对象 学习笔记整理总和
- JSP&Servlet学习笔记(7): 过滤器
- JSP学习笔记(5)_9大内置对象
- JSP学习笔记之二
- jsp&servlet学习笔记
- jsp学习笔记(三)
- JSP学习笔记--JSP标签库
- JSP学习笔记
- jsp学习笔记1
- JavaWeb学习笔记:初识JSP内置对象
- JSP&&SERVLET学习笔记(四):关于HttpServletRequest
- JSP学习笔记之四
- Jsp&Servelet 学习笔记-对一个Servlet创建多个Mapping
- JSP学习笔记之六
- JSP&Servlet学习笔记----第4章