1

I need to set the dynamic value for the var in jstl, My code is

<c:forEach var="entry" items="${mapData}">
    <c:set var="row${entry.key}" value="${entry.value}"/>
</c:forEach>

and want the expected out put like this

var = value

value = key

var value has to be dynamic.

Any help will be appreciated.

3
  • Still not clear what you desire and what's not working? Commented Mar 3, 2017 at 7:38
  • I want to set the dynamic variable name based on map key value. Commented Mar 3, 2017 at 8:14
  • 1
    So what is the problem with your current code? isn't it working? Commented Mar 3, 2017 at 8:28

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.