我的一畝三分地

            BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
            2 隨筆 :: 14 文章 :: 3 評(píng)論 :: 0 Trackbacks

          1 下載JSTL和Tomcat,可以在apache網(wǎng)站上下到
          2 將下載到的JSTL壓縮包解壓,然后把其中的lib文件夾下的文件copy到具體應(yīng)用WEB-INF/lib里,把tld目錄copy到WEB-INF目錄下
          3
          在web.xml文件中加入下面的語(yǔ)句:
          <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/fmt-rt</taglib-uri>
          ??? <taglib-location>/WEB-INF/tld/fmt-1_0-rt.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/core-rt</taglib-uri>
          ??? <taglib-location>/WEB-INF/tld/c-1_0-rt.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/sql-rt</taglib-uri>
          ??? <taglib-location>/WEB-INF/tld/sql-1_0-rt.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>

          <taglib>
          ??? <taglib-uri>http://java.sun.com/jstl/x-rt</taglib-uri>
          ??? <taglib-location>/WEB-INF/tld/x-1_0-rt.tld</taglib-location>
          </taglib>

          ?

          4 測(cè)試
          <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
          ??? pageEncoding="ISO-8859-1"%>
          <%@ taglib prefix="c" uri="<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<html>
          <head>
          <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
          <title>Hello JSTL</title>
          </head>
          <body>
          <c:out value="Hello,JSTL!"/>
          </body>


          評(píng)論

          # re: 在Tomcat中配置JSTL 2007-01-28 17:24 王某某
          在tomcat5.0以后可以不在web.xml里進(jìn)行配置,使用jstl1.1以后的版本,uri應(yīng)該寫(xiě)作http://java.sun.com/jsp/jstl/core。此外,還應(yīng)該在tomcat的\common\endorsed目錄下拷入xalan.jar文件。否則無(wú)法正確解析xml文件  回復(fù)  更多評(píng)論
            


          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 南靖县| 虞城县| 兴安盟| 旬邑县| 昌宁县| 衢州市| 金堂县| 江阴市| 本溪| 临朐县| 扎囊县| 湟中县| 新乡县| 卫辉市| 嘉峪关市| 新晃| 巴林右旗| 伊宁市| 容城县| 井陉县| 房山区| 富顺县| 十堰市| 湛江市| 卓资县| 尉氏县| 英吉沙县| 荥阳市| 河池市| 钟山县| 项城市| 长治县| 平塘县| 壶关县| 基隆市| 兴城市| 吉水县| 克什克腾旗| 长乐市| 竹山县| 故城县|