我的一畝三分地

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

          1 下載JSTL和Tomcat,可以在apache網(wǎng)站上下到
          2 將下載到的JSTL壓縮包解壓,然后把其中的lib文件夾下的文件copy到具體應(yīng)用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里進(jìn)行配置,使用jstl1.1以后的版本,uri應(yīng)該寫作http://java.sun.com/jsp/jstl/core。此外,還應(yīng)該在tomcat的\common\endorsed目錄下拷入xalan.jar文件。否則無法正確解析xml文件  回復(fù)  更多評論
            


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


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 拉萨市| 阳原县| 鄂托克旗| 荆门市| 泾阳县| 扎兰屯市| 兴业县| 灯塔市| 丹巴县| 马公市| 松溪县| 固镇县| 东乌| 平山县| 栖霞市| 黔江区| 德昌县| 陵水| 长白| 普定县| 汤阴县| 慈利县| 义马市| 昆山市| 曲水县| 漳平市| 霍城县| 禄丰县| 双城市| 台北市| 武隆县| 卫辉市| 嘉峪关市| 荆门市| 泽普县| 嵊州市| 镇巴县| 肃宁县| 永春县| 九龙坡区| 轮台县|