- 6
- 0
- 约2.15万字
- 约 68页
- 2017-11-17 发布于河南
- 举报
第5章 JSP基础编程
* * (2) include指令 在Tag文件中也可以使用include指令标记,其使用方法和作用与JSP文件中类似。 * * (3) attribute指令 在Tag文件中通过使用attribute指令,可以让使用它的JSP页面向该Tag文件传递需要的数据。attribute指令的格式如下: %@ attribute name=对象名字 required=true|false type=对象的类型% 注:attribute指令中的name属性是必需的。 比如,一个Tag文件MyTag.tag中有如下的attribute指令: %@ attribute name=length required=true % JSP页面使用Tag标记向调用的Tag文件中name属性指定的字符串变量传递一个字符串,方式如下: 前缀:Tag文件名字 字符串变量名= 字符串 / 或 前缀:Tag文件名字 字符串变量名= 字符串 标记体 /前缀:Tag文件名字 * * 【例5-10】Trangle.tag, chap4-10.jsp chap5_10.jsp %@ page contentType=text/html;Charset=GB2312 % %@ taglib tagdir=/WEB-INF/tags prefix=com
原创力文档

文档评论(0)