【问题标题】:Testing if DynaActionForm property is not empty using OR使用 OR 测试 DynaActionForm 属性是否不为空
【发布时间】:2012-07-27 23:01:39
【问题描述】:

我有 dynaActionForm,表单中包含两个数组(行程和路线)。

现在我需要通过 OR 来检查我的 jsp 页面中的两个数组是否不为空。

<logic:notEmpty property="trip" name="myForm"/>
OR
<logic:notEmpty property="route" name="myForm"/>

我该怎么做? 我使用 JSTL 尝试了以下操作:

<c:if test="${!empty(myForm.trip)}"> </c:if>

它给了我一个错误,说属性“trip”不存在。我相信这是因为我的表单是 DynaActionForm。

【问题讨论】:

    标签: java jsp struts jstl


    【解决方案1】:

    从表单中获取地图,该地图将与 EL 一起使用:

    <c:if test="${!empty myForm.map.trip or !empty myForm.map.route}">
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-12-24
      • 1970-01-01
      • 2011-06-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多