jeudi 5 octobre 2017

append index value to struts tag set

I have a jsp with this line below:

<c:forEach var="firstItem" items="${firstList}" varStatus="loop">
<% LoopTagStatus loopIter = (LoopTagStatus)pageContext.getAttribute("loop");  %>
<s:set var="itVal"><%=loopIter.getIndex()%></s:set>
<s:set var="myVALGot" value="mySessionList[%{#itVal}].myValue"></s:set>
<s:hidden value="%{myVALGot}"></s:hidden> 
</c:forEach>

when i try as , I am getting myValue.But when i try to append the index number i am not able to do it.I also tried by just putting the # symbol.Still no use.I know it can be done using input tags,but I want it only with struts tags for many other reasons.I am pretty sure that appending the "itVal" variable is creating trouble. Kindly help me out in this.




Aucun commentaire:

Enregistrer un commentaire