I have the following 'working' code to produce a table. The value of ${param.field} determines which field will be displayed in column 3. Can I move this out of the c:forEach loop and assign a temp variable to it using c:if/c:set so that I only need to evaluate the value of ${param.field} once and not on every line? ${param.field} will always equal city, cuisine or name.

Thanks,

Jack

<c:forEach items="${restaurantInfo.restaurants}"
  var="restaurant">

<c:set target="${restaurant}"
  property="filterField" value="${param.field}" />
<c:if
  test="${fn:containsIgnoreCase(restaurant.filterValue, param.value)}">

......
<c:choose>
  <c:when
    test="${param.field eq 'city'}">

    <td width="79">
    <div align="left"><font size="1"
      face="Verdana, Arial, Helvetica, sans-serif">
    <c:out value="${restaurant.cuisine}" /> </font></div>
    </td>
  </c:when>

  <c:otherwise>
    <td width="79">
    <div align="left"><font size="1"
      face="Verdana, Arial, Helvetica, sans-serif">
    <c:out value="${restaurant.city}" /> </font></div>
    </td>
  </c:otherwise>
</c:choose>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to