在struts中将list的结果集,放到request.getAttribute(resultList)
在页面上用<logic>标签

解决方案 »

  1.   

    我的意思是诸如此类的语句:
    <%String a = (String)request.getAttribute("a");%>
    ....
    可以用<bean: ........之类的东西代替吗?
      

  2.   

    String 可以直接<bean:write />List 要这样
    <logic:iterate id="vo" name="list">
    <bean:write name="vo" property=""/>
    </logic:iterate>
      

  3.   

    对于单一的对象的输出,如<%String a = (String)request.getAttribute("a");%> 
    可直接用<bean:write name="a"/>对于集合的输出,如<%List resultList = (List)request.getAttribute("result");%>
    可用
    <logic:iterate id="单一对象名" name="result" type="单一对象名类型" property="iterate"  scope="request">
       bean:write name="oneItem" property="name"/>
       </logic:iterate>