JSTL 標籤庫 下載及配置

下載地址: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>


摘自:http://blog.csdn.net/lushuaiyin/article/details/7689574

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章