JSP中的TagLib应用(2)

2016-01-29 12:38 3 1 收藏

JSP中的TagLib应用(2),JSP中的TagLib应用(2)

【 tulaoshi.com - Java 】

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

来源:https://www.tulaoshi.com/n/20160129/1486913.html

延伸阅读
标签: Java JAVA基础
JSP页面上使用你可以使用Taglib Directive来自定义标签定义一个标签库和前缀。 其语法: <%@ taglib uri="URIToTagLibrary" prefix="tagPrefix" % > 示例: <%@ taglib uri="http://www.jspcentral.com/tags" prefix="public" %> <public:loop> . </public:loop> 描述: <%@ taglib %>...
标签: Web开发
  Sun推出的JSP(Java Server Pages)是一种执行于服务器端的动态网页开发技术,它基于Java技术。执行JSP时需要在Web服务器上架设一个编译JSP网页的引擎。配置 JSP 环境可以有多种途径,但主要工作就是安装和配置Web服务器和JSP引擎。 下面就以Tomcat作为JSP引擎,配合Tomcat、Apache、IIS这三种Web服务器来讲述3种搭建JSP运行环...
标签: Web开发
jsp页面 : 代码如下: $(document).ready(function() { setInterval(function myTimer() { //alert('a'); getViews(); },1000); }); //播放 function getViews(){ $.ajax({ 'url':"${pageContext.request.contextPath}/video/getVideos.action?r="+Math.random()+"&open=1", 'data': '', 'dataType': 'json', 'type': 'get', ...
标签: Java JAVA基础
  选择自 hf1650 的 Blog 一、概述 当网络编程越来越方便,系统功能越来越强大,安全性却指数倍地下降。这恐怕就是网络编程的不幸和悲哀了。各种动态内容生成环境繁荣了WWW,它们的设计目标就是为了给开发者更多的力量,给最终用户更多的方便。正因为如此,系统设计师和开发者必须明确地把安全问题作为一个考虑因素,事后追悔很...
标签: Java JAVA基础
  一、概述   当网络编程越来越方便,系统功能越来越强大,安全性却指数倍地下降。这恐怕就是网络编程的不幸和悲哀了。各种动态内容生成环境繁荣了WWW,它们的设计目标就是为了给开发者更多的力量,给最终用户更多的方便。正因为如此,系统设计师和开发者必须明确地把安全问题作为一个考虑因素,事后追悔很难奏效。  ...

经验教程

198

收藏

11
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部