泰仔在線

          java學(xué)習(xí),心情日記,繽紛時(shí)刻
          posts - 100, comments - 34, trackbacks - 0, articles - 0

          關(guān)于struts中tld 文件里配置詳解

          Posted on 2007-01-13 10:17 泰仔在線 閱讀(6178) 評(píng)論(2)  編輯  收藏 所屬分類(lèi): Java 相關(guān)
          這是struts-bean.tld 中write的配置:
          <tag>
          <name>write</name>
          <tagclass>org.apache.struts.taglib.bean.WriteTag</tagclass>
          <bodycontent>empty</bodycontent>
          <attribute>
          <name>bundle</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
          </attribute>
          <attribute>
          <name>filter</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
          </attribute>
          <attribute>
          <name>format</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
          </attribute>
          <attribute>
          <name>formatKey</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
          </attribute>
          <attribute>
          <name>ignore</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
          </attribute>
          <attribute>
          <name>locale</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
          </attribute>
          <attribute>
          <name>name</name>
          <required>true</required>
          <rtexprvalue>true</rtexprvalue>
          </attribute>
          <attribute>
          <name>property</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
          </attribute>
          <attribute>
          <name>scope</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
          </attribute>
          </tag>
          </taglib>


          其中:
          <name>write</name>:這個(gè)Tag的名字
          <tagclass>org.apache.struts.taglib.bean.WriteTag</tagclass>:這個(gè)Tag是由那個(gè)類(lèi)實(shí)現(xiàn)的(這個(gè)class可以在struts.jar包中找到)
          <bodycontent>empty</bodycontent>:這個(gè)Tag可以直接結(jié)尾,不需要填寫(xiě)內(nèi)容
             這里bodycontent有三個(gè)可選值
                jsp        標(biāo)簽體由其他jsp元素組成   
                   如果其有jsp元素,那么標(biāo)簽會(huì)先解釋?zhuān)缓髮⒃氐膶?shí)際值傳入。比如標(biāo)簽體里含有<%=attributeName%>這樣子的jsp元素,此時(shí)標(biāo)簽會(huì)按attributeName的實(shí)際值是什么就傳入什么。這個(gè)是最常用的一個(gè)。
                empty   標(biāo)簽體必須為空   
                   在引用這個(gè)Tag的時(shí)候,可以<bean:write bundle="attributeName" />,而不必<bean:write bundle="attributeName" ></bean:write> 
                tagdependent   由標(biāo)簽解釋?zhuān)粠sp轉(zhuǎn)換 
          <attribute> </attribute>這里標(biāo)識(shí)的是這個(gè)Tag的一個(gè)參數(shù)
          <name>bundle</name>這個(gè)參數(shù)的名字
          <required>false</required>這個(gè)參數(shù)是否是必填相
                如果為true則必須寫(xiě)這個(gè)參數(shù),否則會(huì)報(bào)錯(cuò)
          <rtexprvalue>true</rtexprvalue>是說(shuō)這個(gè)標(biāo)簽的值可以寫(xiě)入
                rtexprvalue:"RUN-TIME EXPRESSION VALUE",是否可以動(dòng)態(tài)賦值,在jsp中如value="<%=attributeName%>"

          Feedback

          # re: 關(guān)于struts中tld 文件里配置詳解  回復(fù)  更多評(píng)論   

          2008-01-21 15:43 by langchao826
          太謝謝你了!

          # re: 關(guān)于struts中tld 文件里配置詳解  回復(fù)  更多評(píng)論   

          2013-01-04 14:08 by sssssss
          不錯(cuò)不錯(cuò)
          主站蜘蛛池模板: 鄂伦春自治旗| 和龙市| 米脂县| 阿克苏市| 六枝特区| 永顺县| 台中县| 修文县| 怀来县| 绩溪县| 郴州市| 堆龙德庆县| 益阳市| 屏山县| 呼和浩特市| 桐梓县| 临沧市| 南宁市| 钟祥市| 福清市| 密云县| 隆昌县| 保靖县| 寿阳县| 定结县| 黄冈市| 开原市| 富源县| 秦皇岛市| 客服| 青岛市| 临西县| 高青县| 且末县| 平遥县| 沁水县| 无锡市| 休宁县| 伊川县| 柳州市| 文登市|