我的一畝三分地

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            2 隨筆 :: 14 文章 :: 3 評論 :: 0 Trackbacks

          1 下載JSTL和Tomcat,可以在apache網站上下到
          2 將下載到的JSTL壓縮包解壓,然后把其中的lib文件夾下的文件copy到具體應用WEB-INF/lib里,把tld目錄copy到WEB-INF目錄下
          3
          在web.xml文件中加入下面的語句:
          <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 測試
          <%@ 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>


          評論

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


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 怀柔区| 磐石市| 东源县| 房产| 申扎县| 信宜市| 迁安市| 闽清县| 略阳县| 台安县| 彝良县| 平利县| 阿克陶县| 康乐县| 若羌县| 大方县| 汝城县| 银川市| 玉门市| 嘉峪关市| 广安市| 剑阁县| 佛冈县| 交口县| 雅江县| 屯昌县| 通化县| 连平县| 呼和浩特市| 额济纳旗| 阿坝县| 中阳县| 石屏县| 固安县| 桐乡市| 隆回县| 台东县| 博客| 达日县| 英吉沙县| 汉沽区|