webber

            BlogJava :: 首頁(yè) :: 聯(lián)系 :: 聚合  :: 管理
            11 Posts :: 2 Stories :: 3 Comments :: 0 Trackbacks

          #

          struts2標(biāo)簽的定義文件 struts-tags.tld

          struts2標(biāo)簽的定義文件 struts-tags.tld。

           

            在工程中使用struts2標(biāo)簽

            一、 struts2標(biāo)簽定義文件在struts2-core-2.0.11.1META-INF 下面,文件名為struts-tags.tld

            二、 如果工程使用了servlet2.3規(guī)范,要做兩件事,就能在工程中使用struts2標(biāo)簽了

            1: 在web.xml中增加標(biāo)簽庫(kù)的定義

          <taglib>
             <taglib-uri>/struts-tags</taglib-uri>
             <taglib-location>/WEB-INF/lib/struts2-core-2.0.11.1.jar</taglib-location>
            </taglib>
          /struts-tags 是struts2標(biāo)簽庫(kù)默認(rèn)的URI,建議使用這個(gè)名稱

            2 在JSP中使用taglib編譯指令導(dǎo)入標(biāo)簽庫(kù) <%@ taglib prefix="s" uri="/struts-tags" %>

            三、 如果使用servlet2.4規(guī)范,不須要在web.xml中增加標(biāo)簽庫(kù)定義,只要做一件事,就行

            1 在JSP中使用taglib編譯指令導(dǎo)入標(biāo)簽庫(kù) <%@ taglib prefix="s" uri="/struts-tags" %>

            四、 struts2標(biāo)簽自動(dòng)提示功能(解決struts2標(biāo)簽出現(xiàn)紅叉)

            1  把struts2包中的struts-tags.tld提取出來(lái),放入本地硬盤上,我放入了E:workspacepicbinWEB-INFtldstruts-tags.tld

            2 eclipse--window--preferences 輸入TLD進(jìn)行搜索 ,選擇Amateras--TLD開(kāi)始添加本地TLD文件,

            點(diǎn)Add ,URI 項(xiàng)輸入:/struts-tags ,Local Path項(xiàng)輸入:E:workspacepicbinWEB-INFtldstruts-tags.tld

            點(diǎn)OK  ,重啟eclipse 寫struts2標(biāo)簽時(shí),就有提示了,紅叉也沒(méi)了

            如圖

          struts2標(biāo)簽的定義文件 struts-tags.tld

          posted @ 2010-01-13 15:26 webber 閱讀(826) | 評(píng)論 (0)編輯 收藏

          僅列出標(biāo)題
          共2頁(yè): 上一頁(yè) 1 2 
          主站蜘蛛池模板: 江津市| 乐至县| 通化市| 平昌县| 平凉市| 化州市| 桂阳县| 苍梧县| 淮滨县| 杭州市| 鲁山县| 鱼台县| 永胜县| 鄯善县| 吴堡县| 亚东县| 浪卡子县| 渭南市| 宁城县| 西青区| 元江| 浦北县| 保亭| 扶风县| 垣曲县| 鹿泉市| 白水县| 威远县| 海南省| 顺义区| 绵阳市| 密山市| 宕昌县| 肇庆市| 台湾省| 河东区| 增城市| 新营市| 福州市| 崇文区| 万源市|