JSTL's <c:forEach ... /> or, if you must,
<logic:iterate ... />.

d.

--- Minghui Yu <[EMAIL PROTECTED]> wrote:

> struts 1.
> 
> I barely made it work by using jsp and bean:define.
> 
> <bean:define id="test" name="book"
> type="org.lonetree.tc.core.Book" />
>   <%
>   Iterator<String> itr=test.getAuthors().iterator();
>   while (itr.hasNext())
>   {
>         out.println(itr.next());
>         out.println("<br>");
>   }
>         %>
> 
> I'd like to know how to do in in a nice way.
> 
> Thanks.
> 
> On Nov 27, 2007 3:57 AM, Omkar Patil
> <[EMAIL PROTECTED]> wrote:
> >
> > Are you using struts1 or struts2?
> >
> > - Omkar
> >
> >
> > Minghui Yu wrote:
> > >
> > > 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,
> > >
> > > --
> > > Thanks & Have a good day,
> > >
> > > YU, Minghui
> > >
> > >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > >
> > >
> > >
> >
> > --
> > View this message in context:
>
http://www.nabble.com/bean%3Awrite-on-a-Collection-tf4881224.html#a13969461
> > Sent from the Struts - User mailing list archive
> at Nabble.com.
> >
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> >
> >
> 
> 
> 
> -- 
> Thanks & Have a good day,
> 
> YU, Minghui
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to