I have a JSP page that receives an ArrayList of event objects, each event object contains an ArrayList of dates. I am iterating through the event objects with the following:
How can I iterate through the dateTimes ArrayList of each event object and print out each events date/times ?
If I understand your question, you essentially have an ArrayList of ArrayLists. JSTL has some fairly odd rules for what a valid "items" "collection" is. This wasn't sufficiently answered by the JSTL 1.2 specification so I went to the source code.
forEach can iterate over:
Word of caution: use of Iterators and Enumerations in this context is potentially problematic as doing so modifies their state and there's no way to reset them (via JSTL).
Anyway, the code is straightforward:
Assuming the event object is merely a collection of dates. If that collection is a property then just replace
${event}
with${event.dates}
or whatever.