JSP

时间:2015-05-01 06:48:26

标签: jsp jstl

我是jstl的新手jsp。我有以下要求,我必须评估嵌套的jstl表达式。请看下面的代码。

<c:forEach varStatus="status" begin="0" end="19">
<input type="text"
value="${dataTableVo.orderList[${status.index}].mtocCode}" --->Problem area
</c:forEach>

我应该能够使用表达式$ {dataTableVo.orderList [$ {status.index}]。mtocCode}来获取值。 但它不起作用。我不应该在foreach循环中使用items属性。 值应如下。 $ {dataTableVo.orderList [0] .mtocCode}。 $ {dataTableVo.orderList [1] .mtocCode} .....所以一直到19。 请分享这个场景的任何想法。

1 个答案:

答案 0 :(得分:1)

你不需要像那样嵌套它。只写一个表达式:

${dataTableVo.orderList[status.index].mtocCode}