一.JSTL库
standard.jar
jstl.jar
二.tld配置
1.非自动加载方式
(1)拷贝tld文件
将tld文件拷到WEB-INF的tld文件夹下
(2)web.xml
<jsp-config>
<taglib>
<taglib-uri>http://java./jstl/core</taglib-uri>
<taglib-location>/WEB-INF/tld/c.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java./jstl/fmt</taglib-uri>
<taglib-location>/WEB-INF/tld/fmt.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java./jstl/fn</taglib-uri>
<taglib-location>/WEB-INF/tld/fn.tld</taglib-location>
</taglib>
</jsp-config>
(3)jsp中引用taglib
<%@ taglib prefix="c" uri="http://java./jstl/core" %>
2.自动加载方式
Servlet2.4规范提供了对tld文件的自动加载,tld文件在standard.jar的META-INF文件夹中。
如:c.tld文件提供了对核心jstl标签的描述
<taglib xmlns="http://java./xml/ns/j2ee"
xmlns:xsi="http://www./2001/XMLSchema-instance"
xsi:schemaLocation="http://java./xml/ns/j2ee http://java./xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
version="2.0">
<description>JSTL 1.1 core library</description>
<display-name>JSTL core</display-name>
<tlib-version>1.1</tlib-version>
<short-name>c</short-name>
<uri>http://java./jsp/jstl/core</uri>
可以看到其引用的uri为http://java./jsp/jstl/core
则在jsp中引用taglib为: <%@ taglib prefix="c" uri="http://java./jsp/jstl/core" %>