<logic:iterate id="function" name="listFunction">
    <logic:iterate id="f" name="function" property="authoritys">
         <logic:equal name="f" property="authoritys.authorityName" value="管理" >
               <a href="order.do?operate=doGetAll">管理</a>
         </logic:equal>
     </logic:iterate>
</logic:iterate>
authoritys是function里面一对多的关系得来的。有好几个,我想判断一下它是否与管理相等,如果相等就把下面有链接的管理显示出来。这样一个一个的判断。但是我这样写,它老是会说<logic:equal name="f" property="authoritys.authorityName" value="管理" >这边有错误,我已经看了很多遍书了,但是怎么改它老说这边有错。我很是郁闷啊。请大家看看是哪里错了。谢谢了

解决方案 »

  1.   

     <logic:equal name="authoritys.authorityName" value="管理" > ?
      

  2.   

    <logic:iterate id="f" name="function" property="authoritys"> 
            <logic:equal name="f.authorityName" value="管理" >看清楚循环的对象  应该是这样吧
      

  3.   

     <logic:equal name="f" property="authoritys.authorityName" value="管理" > 改为:
     <logic:equal name="f" property="f.authorityName" value="管理" > 
      

  4.   

    补充一下
    在function里的字段是这个样子的
    private Integer id;//private Integer userId;private Integer authorityId;

    private UserInfo user;

    private Set authoritys=new HashSet();

    在authorit里只有id和authorityName两个属性请大家帮帮忙啊
    我比较急呢
    基本上时在线等的
    谢谢大家了
      

  5.   

    <c:if test=${authoritys.authorityName=='管理'}>判断</c:if>
      

  6.   

    http://hi.csdn.net/link.php?url=http://blog.csdn.net%2Ffrank3g
    可以参考下看看