My JSP receives an ArrayList
of beans from a Struts2 action.
I want to iterate over them and print every bean and its properties per line.
How can I do this using Struts2 tags?
Use <s:iterator>
tag.
<s:iterator value="beans">
<p>Property foo: <s:property name="foo" /></p>
<p>Property bar: <s:property name="bar" /></p>
</s:iterator>
An overview of all tags can be found in their own documentation: tag reference. Bookmark it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With