nesting varstatus into var as index for method in jstl foreach -
is there way use varstatus index (integer param) var's method in jstl foreach loop in jsp pages?
i want this:
<c:foreach items="${pizza1.getfeltetlist()}" var="aktpizza" varstatus="index" > <tr> <td>${index.index+1}</td> <td>${aktpizza.nev}</td> <td>${aktpizza.ar}</td> <td><a href="/pizzaordermvc/add/${aktpizza.getafeltet(${index.index+1})}">add</a></td> </tr> </c:foreach>
so getafeltet(int i) method requires int parameter , want pass actual index of varstatus. other fields above populated correctly. should correct syntax achieve this?
you can't , don't need nest ${...}
in each other. have one.
<a href="/pizzaordermvc/add/${aktpizza.getafeltet(index.index+1)}">add</a>
Comments
Post a Comment