tiger0516
asked on
bean:write on a Collection (Set<String>)
In my Action, I have: request.setAttribute("book ", book);
book is a Book object, which has a getAuthors method. getAuthors
returns a collection (Set<String>)
in JSP page, I want to list authors one by one. How shall I do?
<bean:write name="book" property="authors" /> does not work as I want.
Thanks,
book is a Book object, which has a getAuthors method. getAuthors
returns a collection (Set<String>)
in JSP page, I want to list authors one by one. How shall I do?
<bean:write name="book" property="authors" /> does not work as I want.
Thanks,
ASKER
What's the better way to do it by using just struts tags?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
<bean:define id="test" name="book" type="org.lonetree.tc.core
<%
Iterator<String> itr=test.getAuthors().iter
while (itr.hasNext())
{
out.println(itr.next());
out.println("<br>");
}
%>