編輯自訂標籤庫的 Web 部署描述子檔案

Web 部署描述子檔案可以包含 <taglib-uri> 及 <taglib-location> 標籤,將 URI 對映至實際的 TLD 檔。 <taglib-uri> 作為以 WEB-INF/taglib.tld 形式發佈的 TLD 檔的別名。 這可讓您縮短 JSP 檔中的 taglib 指引。

程序

  1. 在網頁視景的「企業瀏覽器」視圖中展開 Web 專案。
  2. 用滑鼠右鍵按一下「部署描述子」並選取開啟。 這時會開啟 Web 部署描述子編輯器。
  3. 按一下編輯器中的標籤來編輯部署描述子。 如需這些標籤的相關資訊,請參閱 Web 部署描述子編輯器的相關主題。 使用「程式碼」頁面直接編輯 Web 部署描述子原始檔。

範例

以下是 Web 部署描述子檔案中使用的 <taglib-uri> 及 <taglib-location> 標籤的範例:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
</web-app>
<display-name>helloWorld-server</display-name>
<taglib>
     <taglib-uri>mytags</taglib-uri>
     <taglib-location>WEB-INF/taglib.tld</taglib-location>
</taglib>
</web-app>
Icon that indicates the type of topic Task topic
Timestamp icon Last updated: last_date

File name: tedwebdepdesc.html