带有属性的标记taglib
来源:互联网 发布:蚁群优化算法 编辑:程序博客网 时间:2024/05/01 23:04
注意:要传递的参数是String形式的,如果要改成int或其他形式,要在tld文件中的标记Type来指定
只需在无属性标记的基础上稍微该下...
如:<hello:helloTag name="kendy" sex="boy"/>
web.xml中不用改动,假设带属性的标记和无属性标记建在同一个标记库里...
改动tld文件 增加<tag><name>...</name><required>true</required><rtexprvalue>true</rtexprvalue></tag>
如:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"> <taglib> <tlib-version>1.0</tlib-version> <jsp-version>1.2</jsp-version> <short-name>helloTag</short-name> <tag> <name>helloTag</name> <tag-class>tag.Hellotag</tag-class>
</tag> <tag> <name>helloTag2</name> <tag-class>tag.Hellotag2</tag-class> <attribute> <name>name</name> <required>true</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>sex</name> <required>true</required> <rtexprvalue>true</rtexprvalue> </attribute> </tag> </taglib>
在实现类中要加入所有的属性使之成为成员变量...
加入属性的get 和set 方法...
...................................................................................................................................
- 带有属性的标记taglib
- 一个带有标记的SeekBar
- 读取带有NaN标记的数据格式
- 读取带有标记文件的函数接口。
- 最简单的自定义JSP标记库(TagLib)配置
- 表格的标记属性
- pager-taglib标签的相关属性
- taglib标签的uri属性 错误
- Struts1--Taglib(标记库)小记
- Struts标记库taglib介绍
- Flex读取带有HTML标记的XML出错的解决办法
- form标记的Enctype 属性
- form标记的Enctype 属性
- 常用的css标记属性
- 常用的csss标记属性
- jsp中taglib属性
- 自定义标记库开发之带有输入输出参数的标记开发
- html居中的元素带有float属性
- SOA巨浪 IT产业迎来新浪潮
- ARM的异常中断机制
- jsp实现中文文件名下载
- jquery UI学习
- 浅复制和深度复制 clone()
- 带有属性的标记taglib
- 程序员心里
- SQL中的多表更新及注意事项
- SOA治理:为服务提供者和使用者搭一座桥梁
- jta 与jdbc事务
- There is insufficient memory. Save the document now.
- 跨数据库表相同结构的插入SQL语句
- 企业网安全与风险评估
- 领跑SOA IBM带您步入SOA成功之旅