当前位置: 首页 > 图文教程 > 网络编程 > JSP > JSP中的TagLib应用(2)

JSP
我认为JSP有问题(上)
我认为JSP有问题(下)
jsp“抓”网页代码的程序
关于在bean里面打印html的利弊看法
bean里面如何打印到html页面
jdbc3中的RowSet 接口规范
Apusic Application Server1.0中jsp源代码泄漏漏洞
Unify的eWave ServletExec拒绝服务漏洞
通过提交超长的GET请求导致IBM HTTP Server远程溢出
在HTTP请求中添加特殊字符导致暴露JSP源代码文件
Resin 1.2 重要源代码暴露漏洞
多中WEB服务器的通用JSp源代码暴露漏洞
Tomcat 暴露JSP文件内容
IBM WebSphere Application Server 暴露JSP文件内容
JRun 2.3.x 范例文件暴露站点安全信息
BEA WebLogic 暴露源代码漏洞
IBM WebSphere Application Server 3.0.2 存在暴露源代码漏洞
Tomcat 3.1 存在暴露网站路径问题
Sun Java Web Server 能让攻击者远程执行任意命令
Netscape 修复 JAVA 安全漏洞

JSP中的TagLib应用(2)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-02   浏览: 46 ::
收藏到网摘: n/a

2、开始

现在让我们逐步深入的了解xml在jsp中的应用吧.

首先需要定义tld文件和相应tag处理的java类文件.然后在jsp通过定义的语法使用tag,

让我们来看看下面这个XML文件。

==================taglib.tld===========================

PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"

"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">

1.0

1.1

Java Pet Store Demo custom tags

insert

com.sun.estore.taglib.InsertTag

JSP

An insertion tag

id

false

true

template

true

true

parameter

true

true

CreateTemplate

com.sun.estore.taglib.CreateTemplateTag

JSP

Create a template object and store in the request with the specified name

id

false

true

template

true

true

screen

true

true

Screen

com.sun.estore.taglib.TemplateScreenTag

JSP

A template screen object

screen

true

true

Parameter

com.sun.estore.taglib.TemplateParameterTag

JSP

A template parameter object

parameter

true

true

value

true

true

direct

true

true
===========================================================

这是J2EE Blueprints 里提供的sample------Pet Store里面的一个TLD文件。

下面对TLD文件进行说明

TagLib Descriptor