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

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -