jsp taglib指令_JSP Taglib指令

jsp taglib指令

The taglib directive is used to define tag library that the current JSP page uses. A JSP page might include several tag library. JavaServer Pages Standard Tag Library (JSTL), is a collection of useful JSP tags, which provides mahy commonly used core functionalities. It has support for many general, structural tasks such as iteration and conditionals, readymade tags for manipulating XML documents, internationalization tags, and for performing SQL operations. Syntax of taglib directive is:

taglib指令用于定义当前JSP页面使用的标记库。 一个JSP页面可能包含几个标记库。 JavaServer Pages标准标记库(JSTL)是有用的JSP标记的集合,该标记提供了许多常用的核心功能。 它支持许多常规的结构性任务,例如迭代和条件,用于处理XML文档的现成标签,国际化标签以及执行SQL操作。 taglib指令的语法为:

<%@ taglib prefix="prefixOfTag" uri="uriOfTagLibrary" %>

The prefix is used to distinguish the custom tag from other libary custom tag. Prefix is prepended to the custom tag name. Every custom tag must have a prefix.

该前缀用于将自定义标签与其他库自定义标签区分开。 前缀是自定义标签名称的前缀。 每个自定义标签都必须有一个前缀。

The URI is the unique name for Tag Library.

URI是标签库的唯一名称。

Jsp Taglib Directive

You can name the prefix anything, but it should be unique.

您可以为前缀命名,但应唯一。

JSP:使用Taglib指令 (JSP: Using Taglib Directive)

To use the JSTL in your application you must have the jstl.jar in your webapps /WEB-INF/lib directory. Download the jar file from Apache Standard Taglib page.

要在应用程序中使用JSTL,必须在webapps /WEB-INF/lib目录中具有jstl.jar 。 从Apache Standard Taglib页面下载jar文件。

There are many readymade JST Libraries available which you use to make your life easier. Following is a broad division on different groups of JST libraries :

有许多现成的JST库可供您使用,它们使您的生活更轻松。 以下是对不同组的JST库的大致划分:

  1. Core Tags - URI → http://java.sun.com/jsp/jstl/core

    核心标签-URI→http://java.sun.com/jsp/jstl/core

  2. Formatting Tags - URI → http://java.sun.com/jsp/jstl/fmt

    格式标签-URI→http://java.sun.com/jsp/jstl/fmt

  3. SQL Tags - URI → http://java.sun.com/jsp/jstl/sql

    SQL标记-URI→http://java.sun.com/jsp/jstl/sql

  4. XML Tags - URI → http://java.sun.com/jsp/jstl/xml

    XML标记-URI→http://java.sun.com/jsp/jstl/xml

  5. JSTL Functions - URI → http://java.sun.com/jsp/jstl/functions

    JSTL函数-URI→http://java.sun.com/jsp/jstl/functions

You can check the complete JST Library here : Apache Standard Taglib API

您可以在此处检查完整的JST库: Apache Standard Taglib API

翻译自: https://www.studytonight.com/jsp/jsp-taglib-directive.php

jsp taglib指令

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值