posts - 33,  comments - 11,  trackbacks - 0
             1. logic:equal
                    該標簽為等于比較符。
                    eg1. 比較用戶的狀態屬性是否1,若為1,輸出"啟用";
                           <logic:equal   name="user"   property="state"   value="1">
                               啟用
                           </logic:equal>
                   eg2. 如果上例中的value值是動態獲得的,例如需要通過bean:write輸出,因struts不支持標簽嵌套,可采用EL來解決該問題。
                          <logic:equal   name="charge"   property="num"   value="${business.num}">    IT資訊之家 www.it55.com
                              ......
                          </logic:equal>
          2. logic:present
                     此標簽用于判斷request對象傳遞參數是否存在。
                     eg1. user對象和它的name屬性在request中都存在時,輸出相應字符串:
                        <logic:present name="user" property="name">
                            user對象和該對象的name屬性都存在
                      </logic:present>  www.it55.com在線教程
                    eg2. 若有一個名字為“user”的JavaBean,輸出對應字符串:
                       <logic:present name="user" >
                            有一個名字為“user”的JavaBean。
                      </logic:present>
                    eg3. 
                      <logic:present header="user-agent">
                            we got a user-agent header.
                      </logic:present>
          3. logic:iterator
                      用于顯示列表為collection的值(List ,ArrayList,HashMap等)。
                      eg1. 逐一輸出用戶列表(userlList)中用戶的姓名
                         <logic:iterate  id="user" name="userList">
                            <bean:write name="user" property="name"/><br>

          IT資訊之家 www.it55.com


                         </logic:iterate>
                      eg2. 從用戶列表中輸出從1開始的兩個用戶的姓名
                         <logic:iterate  id="user" name="userList" indexId="index"  offset="1" length="2">
                            <bean:write name="index"/>.<bean:write name="user" property="name"/><br>
                         </logic:iterate>
                      eg3. logic:iterator標簽的嵌套舉例
                          <logic:iterate id="user" indexId="index" name="userList">
                                 <bean:write name="index"/>. <bean:write name="user" property="name"/><br>
          http://www.it55.com/

                                 <logic:iterate id="address" name="user" property="addressList" length="3" offset="1">
                                     <bean:write name="address"/><br>
                                 </logic:iterate>
                         </logic:iterate> 免費
          posted on 2007-12-18 10:52 方濤升 閱讀(368) 評論(0)  編輯  收藏 所屬分類: struts

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


          網站導航:
          博客園   IT新聞   Chat2DB   C++博客   博問  
           
          <2007年12月>
          2526272829301
          2345678
          9101112131415
          16171819202122
          23242526272829
          303112345

          常用鏈接

          留言簿(2)

          隨筆分類

          隨筆檔案

          文章分類

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 新闻| 天全县| 集安市| 迭部县| 寻甸| 栾城县| 沙坪坝区| 闽侯县| 宜君县| 建昌县| 陇南市| 文成县| 北海市| 新兴县| 桂平市| 鹿邑县| 弥勒县| 和田县| 宁城县| 宁津县| 莱芜市| 恩施市| 邵武市| 玉龙| 邻水| 桓仁| 墨玉县| 分宜县| 抚松县| 康马县| 宁乡县| 宽城| 兴化市| 改则县| 太原市| 漳州市| 内江市| 澄江县| 山阳县| 安平县| 江城|