struts2 - how to iterate Set in s:iterator in Struts 2 -
I have a set with a list of objects, I want to iterate this set in s: iterator in struts 2 How can I get the tag and one's use of the object's property?
Sample code:
class employee {string name; String era; ... gates and setters ...} ... set & lt; Employee & gt; EmpSet = new hashset & lt; Employee & gt ;; In JSP: I want to use the name of the employee
& gt; & Lt; Property value = ??? (How to get the employee's name) & gt; & Lt; / S: iterator & gt;
Thanks
Iterator docs:
You want to do something like this:
& lt; S: iterator value = "empSet" & gt; & Lt; P & gt; Name is: & lt; S: property value = "name" /> gt; & Lt; / P & gt; & Lt; / S: iterator & gt;
Note that you will need a waiter for empSet on your Action Class.
Comments
Post a Comment