Web 部署描述子檔可以含有將 URI 對映至實際 TLD 檔的 <taglib-uri> 和 <taglib-location> 標示。 <taglib-uri> 是將發佈為 WEB-INF/taglib.tld 的 TLD 檔之別名。 它可讓您縮短 JSP 檔中的 taglib 指引。
<?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>