`
binyan17
  • 浏览: 200309 次
  • 性别: Icon_minigender_1
  • 来自: 重庆
社区版块
存档分类
最新评论

【转】tld 标签配置说明

阅读更多

<?xmlversion="1.0"encoding="UTF-8"?>
<!DOCTYPEtaglibPUBLIC"-//SunMicrosystems,Inc.//DTDJSPTagLibrary1.1//EN""http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
<taglib>
<tlib-version>1.0</tlib-version><!--标志库版本号-->
<jsp-version>2.0</jsp-version><!--JSP版本-->
<short-name>examples</short-name><!--taglib指令的prefix值-->
<discription>Simpleexamplelibrary.</discription>

<tag>
<name>hello</name>
<tag-class>taglib.HelloTag</tag-class>
<tei-class>ProfileTagInfo</tei-class><!--该类继承了TagExtraInfo类-->
<!--Thismeansthatthetagcannothavescriptingelements(〈%,〈%=,〈%!)inthebody.-->
<body-content>scriptless</body-content>
<discription>Firstexample</discription>
<variable>
<name-given>value</name-give>
<!--Thismeansthattheusageofthetaginajsppagemustcontainanattributenamed"var".-->
<name-from-attribute>var</name-from-attribute>
<variable-class>java.lang.Double</variable-class>
<scope>AT_BEGIN</scope><!--itcanbe:AT_BEGIN,AT_END,NESTED-->
</variable>
</tag>

<tag>
<name>put</name>
<tag-class>taglib.template.PutTag</tag-class><!--实现了ClassicTag-->
<!--3个可选值:JSP在运行期间直接计算正文;tagdependent不计算正文,并将正文传给标志解释器处理;empty正文为空-->
<body-content>JSP</body-content>
<discription>Secondexample.</discription>
<attribute>
<name>age</name>
<required>true</required><!--表示该属性是强制还是可选true和yes、false和no意思一样-->
<rtexprvalue>true</rtexprvalue><!--是否可以通过表达式动态求值-->
<type>java.lang.Integer</type>
</attribute>
</tag>

<tag>
<name>price</name>
<tag-class>com.abc.PriceTag</tag-class>
<body-content>scriptless</body-content>
<variable>
<name-from-attribute>var</name-from-attribute>
<scope>NESTED</scope>
</variable>
<attribute>
<name>itemcode</name>
<required>true</required>
<rtexprvalue>false</rtexprvalue>
<attribute>
<tag>
<!--以上的标签在JSP中表示为:
<item:priceitemcode="IT001"var='cost'/>
${cost}
</item:price>
-->

<tag>
<name>functions</name>
<tag-class>myTags.MathTag</tag-class><!--实现了SimpleTag-->
<body-content>empty</body-content><!--beacuseJSPfragmentnotsupportscriptlets,itcannotbe"JSP"!
Itcanbe:scriptless,tagdependent,empty.-->
<attribute>
<name>num</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<fragment>true</fragment>
</attribute>
<dynamic-attributes>true</dynamic-attributes>
<description>
SendsamathexpressiontotheJSP
</description>
</tag>

<tag-file><!--定义标签文件-->
<name>tag2</name>
<path>/WEB-INF/tags/HelloWorld.tag</path>
</tag-file>

<function><!--EL的自定义函数-->
<discription>CountsthenumberofwordsinthegivenString.</discription>
<name>numWords</name>
<function-class>com.iee.TextEditor</function-class>
<function-signature>intnumWords(java.lang.String)</function-signature>
</function>
</taglib>
 文章出处:http://xiaoruanjian.iteye.com/blog/895301
分享到:
评论

相关推荐

    jsoup jar包

    (2)标签库配置: &lt;taglib-uri&gt;sitemesh-decorator /WEB-INF/tld/sitemesh-decorator.tld &lt;taglib-uri&gt;sitemesh-page /WEB-INF/tld/sitemesh-page.tld 4.在WebContent/WEB-INF目录下建sitemesh.xml...

    Spring中文帮助文档

    4.7.3. FileSystemResource 说明 5. 校验,数据绑定,BeanWrapper,与属性编辑器 5.1. 简介 5.2. 使用Spring的Validator接口进行校验 5.3. 从错误代码到错误信息 5.4. Bean处理和BeanWrapper 5.4.1. 设置和...

    Spring API

    4.7.3. FileSystemResource 说明 5. 校验,数据绑定,BeanWrapper,与属性编辑器 5.1. 简介 5.2. 使用Spring的Validator接口进行校验 5.3. 从错误代码到错误信息 5.4. Bean处理和BeanWrapper 5.4.1. 设置和...

    spring chm文档

    配置标签库 13.9.2. form标签 13.9.3. input标签 13.9.4. checkbox标签 13.9.5. radiobutton标签 13.9.6. password标签 13.9.7. select标签 13.9.8. option标签 13.9.9. options标签 13.9.10. textarea...

    Spring 2.0 开发参考手册

    配置标签库 13.9.2. form标签 13.9.3. input标签 13.9.4. checkbox标签 13.9.5. radiobutton标签 13.9.6. password标签 13.9.7. select标签 13.9.8. option标签 13.9.9. options标签 13.9.10. textarea...

    Spring-Reference_zh_CN(Spring中文参考手册)

    配置标签库 13.9.2. form标签 13.9.3. input标签 13.9.4. checkbox标签 13.9.5. radiobutton标签 13.9.6. password标签 13.9.7. select标签 13.9.8. option标签 13.9.9. options标签 13.9.10. textarea标签 13.9.11...

    ssh(structs,spring,hibernate)框架中的上传下载

     此外lazy="true"说明地返回整个Tfile对象时,并不返回fileContent这个字段的数据,只有在显式调用tfile.getFileContent()方法时才真正从数据库中获取fileContent的数据。这是Hibernate3引入的新特性,对于包含重量...

    fckedit编辑器

    编辑器 FCKeditor2.4 使用说明 .下载 FCKeditor2.3 (FCKeditot for java) FCKeditor2.4 (FCKeditor基本文件) 以下是下载地址: http://www.fckeditor.net/download/default.html 2.建立项目: 建立项目tomcat...

    Struts原理、开发及项目实施

    Struts原理、开发及项目实施 Holen 2002-9-12 &lt;br/&gt;1、 摘要...charset=UTF-8" language="java" %&gt; &lt;%@ taglib uri="/WEB-INF/Struts-bean.tld" prefix="bean" %&gt; &lt;%@ taglib uri="/WEB-INF/Struts-...

    freemarker总结

    JAVA模版引擎Freemarker常用标签(一) 1. if指令 这是一个典型的分支控制指令,该指令的作用完全类似于Java语言中的if,if指令的语法格式如下: &lt;#if condition&gt;... &lt;#elseif condition&gt;... &lt;#elseif condition&gt;......

Global site tag (gtag.js) - Google Analytics