<logic:notEmpty name="formBean" property="terminals">
<logic:iterate id="terminal" name="formBean"
property="terminals" indexId="index">
<TR>
<td height="26" align="left" width="8%">
<html:radio idName="terminal" property="terminalId" name="formBean" value="id">
</html:radio>
</td>
<td height="26" align="left" width="38%"><bean:write
name="terminal" property="sn" /></td>
<td height="26" align="left" width="21%"><bean:write
name="terminal" property="osName" /></td>
<td width="33%" height="26" align="left"><bean:write
name="terminal" property="description" /></td>
</TR>
</logic:iterate>
</logic:notEmpty>

解决方案 »

  1.   

    terminals:为arrayList
    其中为terminal pojo
      

  2.   

    octer的方法不好使吗 ?应该可以阿
      

  3.   

    能否给个简单的例子!
    我的信箱:[email protected]
      

  4.   

    能否给个简单能运行的例子!
    我的信箱:[email protected]
      

  5.   


    <logic:iterate name="dataList" id="item">
    <logic:present name="item" property="name">
    Your Name:<bean:write name="item" property="name"/>
    </logic:present>
    </logic:iterate>dateList是一个List,其中含有Map
    name是Map中的key.
      

  6.   

    自己建立一个jsp页面,内容如下:
    <%
        HashMap months = new HashMap();
        months.put("Jan","January");
        months.put("Feb","February");
        months.put("Mar","March");
        request.setAttribute("months",months);
    %>
    <logic:present name="months">
        <logic:iterate id="element" indexId="ind" name="months">
            <bean:write name="ind" />
            <bean:write name="element" property="key" />
            <bean:write name="element" property="value" /> <br>
        </ogic:iterate>  <p>
    </logic:present>输出结果为:
    0.Mar:March
    1.Feb:February
    2.Jan:January
      

  7.   

    logic:notPresent和logic:present 你只要用一种就可以了!
      

  8.   

    logic:notPresent和logic:present类似于
    if(true){}
    if(!false){}
      

  9.   

    200能不能给个带formBean的能运行的例子呀,各位大侠??
      

  10.   

    自己写最好啊,就一个标签的事不明白,现在告诉你,书上弄来的,写得好明白了,希望对你有用
    &#61548; <logic:present>
    &#61548; <logic:notPresent>
    它们的功能是在计算标记体之前判断特定的项目是否存在。标记的属性和属性值决定了要进行检查的项目。
    属性 描述
    Cookie 由这个属性指定的cookie将被检查是否存在
    Header 由这个属性指定的请求标头将被检查是否存在
    parameter 由这个属性指定的请求参数将被检查是否存在
    Name 如果没有设置property属性,那么有这个属性指定的bean将被检查是否存在。如果设置
             了那么bean和bean属性都将被检查是否存在。
    property 检查有name属性指定的bean中是否存在指定的属性
    Scope 如果指定了bean的名称,这就是bean的作用域。如果没有指定作用域,搜索的范围从页到应
             用程序作用域。
    Role 检查当前已经确认的用户是否属于特殊的角色
    User 检查当前已经确认的用户是否有特定的名称
    例如:
    <logic:notPresent name=”bean” property=”prop” scope=”page”>
    The bean property bean.prop is not present
    </logic:notPresent>
    标记判断在页作用域中是否存在一个名为”bean”的bean,并且bean有一个prop属性,不存时就执行标签包含的内容&#61548;<logic:present>则是存在时执行标签包含的内容在逻辑标记库中定义了<logic:iterate>标记,它能够根据特定集合中元素的数目对标记体的内容进行重复的检查。集合的类型可以是java.util.Iterator,java.util.Collection
    ,java.util.Map或是一个数组。有三种方法可以定义这个集合:
    &#61548; 使用运行时间表达式来返回一个属性集合的集合
    &#61548; 将集合定义为bean,并且使用name属性指定存储属性的名称。
    &#61548; 使用name属性定义一个bean,并且使用property属性定义一个返回集合的bean属性。
    当前元素的集合会被定义为一个页作用域的bean。属性如下,所有这些属性都能使用运行时表达式。
    属性 描述
    collection 如果没有设置name属性,它就指定了要进行重复的集合
    Id 页作用域bean和脚本变量的名称,它保存着集合中当前元素的句柄
    indexed 页作用域JSP bean的名称,它包含着每次重复完成后集合的当前索引
    Length 重复的最大次数
    Name 作为集合的bean的名称,或是一个bean名称,它由property属性定义的属性,是个集合
    Offset 重复开始位置的索引
    property 作为集合的Bean属性的名称
    Scope 如果指定了bean名称,这个属性设置bean的作用域。若没有设置,搜索范围从页到应用程序作用域
    Type 为当前定义的页作用域bean的类型
    例如:
    <logic:iterate id=”currentInt” collection=”<% =myList %>”  type=”java.lang.Integer”
       offset=”1”
       length=”2”>
        <% =currentint %>
        </logic:iterate>
    代码将从列表中的第一个元素开始重复两个元素并且能够让当前元素作为页作用域和java.lang.Integer类型的脚本变量来使用。也就是说,如果myList包含元素1,2,3,4等,代码将会打印1和2。