0

how i can do this with JSTL and EL ?

<c:foreach var="item" items="${myList}">
      <c:foreach var="item2" items="${myList2${item}}">
       ......
      </c:foreach>
</c:foreach>

I want put the value of "item" inside "items" of the second foreach .

"Items" in the second foreach is calculated dynamically by concatenating the "item" value of the first loop and "myList" String.

Thanks

user2602584
  • 737
  • 2
  • 7
  • 25
  • i asked for something different from the already answred question ! **"Items"** in the second foreach is calculated **dynamically** by concatenating the **"item"** value of the first loop and **"myList"** String. – user2602584 Mar 12 '16 at 09:45
  • If you create a String using concatenation for the "items attribute, then it just points to a String. You can do it using items="myList2${item}" but it doesn't work because it doesn't point to any List. This question is similar to http://stackoverflow.com/questions/35893617/how-to-get-the-value-of-a-value-in-cforeach Can you create a "List of lists" like I did in the first part of my answer over there? – rickz Mar 12 '16 at 16:05

0 Answers0