下載地址:http://archive.apache.org/dist/jakarta/taglibs/standard/binaries/
JSTL 標簽庫的配置:
按照上面的地址下載 jar 包。然后按照下面的步驟在 tomcat 服務器上進行配置。
首先,在 Tomcat 的工作目錄,也就是安裝目錄下的 webapps/Root 目錄下,新建一個 WEB-INF 文件夾,并在 WEB-INF 文件夾下新建一個 lib 文件夾,然后把下載下來的壓縮包中 lib 文件夾中的 standard.jar 和 jstl.jar 復制到該 lib 文件夾中,接下來把壓縮包中整個 tld 文件夾復制到 WEB-INF 文件夾下。在 WEB-INF 文件夾中的 web.xml 中修改(如果沒有,新建一個):
<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<display-name>Welcome to Tomcat</display-name>
<description>
Welcome to Tomcat
</description>
<taglib>
<taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
<taglib-location>/WEB-INF/tld/fmt.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/tld/c.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/sql</taglib-uri>
<taglib-location>/WEB-INF/tld/sql.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/x</taglib-uri>
<taglib-location>/WEB-INF/tld/x.tld</taglib-location>
</taglib>
</web-app>