1

I have a forEach loop that looks like this:

<c:forEach var="getDetailsList" items="${getDetailsList}">

</c:forEach>

Each loop in the list looks like this:

id=1
desc=HELLO WORLD
203=1
211=0

id and desc are always the same but 203 and 211 would be dynamic numbers.

When I try to access 203 and 211 e.g.

<c:out value="${getDetailsList.203}"/>

I get a 500 error:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Is what I'm trying to do simply not achievable with JSTL?

Duckula
  • 13
  • 3
  • 1
    Hi, when you get a 500 error you should look up the actual exception and stack trace in the server logs. The answer is right there. – BalusC Aug 28 '19 at 10:26

2 Answers2

0

is it a map ?? if its a map you can you below URL to refer. its possible to iterate list/map from JSTL .

Get value from hashmap based on key to JSTL

0

If it is a key value pairs like a HashMap, you can always print them using key and values instead of accessing the variable directly.

<c:forEach var="getDetailsList" items="${getDetailsList}">
    Key is ${getDetailsList.key}
    Value is ${getDetailsList.value}
</c:forEach>

If it is not a key value pair, please post the stacktrace to suggest more options.