I have some code! The code looks like this:
<c:forEach var="element" items="%{serviceList.getServices()}">
<p>Hello!</p>
</c:forEach>
"serviceList" is a bean, with a method on it called getServices(). getServices() returns an ArrayList, so I naturally assumed that the above code would take the arraylist, and iterate through it putting each element of the list into the variable 'element'.
Not so! When I view the page, Hello gets printed once (the size of getServices() is 2, and I can show this directly by printing it out on the page.
The tag itself works:
<c:forEach begin="1" end="10">Hello, World!<br></c:forEach>
Prints out what you would expect. So it must be something to do with the items I'm passing in. Any help?
Oh, and this is using JSTL 1.1.2, Struts 2.1.6, and the latest version of Java.