我的一畝三分地

            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è)用戶(hù)登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 伽师县| 交口县| 周口市| 弋阳县| 和龙市| 大方县| 和平县| 得荣县| 屏南县| 乐至县| 三原县| 米脂县| 贵阳市| 万源市| 常德市| 宣城市| 沛县| 皋兰县| 黄平县| 临澧县| 繁峙县| 张掖市| 潞西市| 五常市| 高雄市| 衡东县| 襄汾县| 修武县| 芜湖县| 织金县| 武川县| 淮阳县| 盐津县| 论坛| 长岛县| 吉木乃县| 阜阳市| 连城县| 重庆市| 襄樊市| 滨州市|