try to assign <logic:iterate> element's "id" attribute to another name.Actually it is a local variable name which will be used by <logic:write> element's name attribute.
--- Per Lovdinger <[EMAIL PROTECTED]> 的正文:> > Hi there, > I'm Struts newie and have a question about the > iterate > tag. > When I'm creating an ArrayList with 2 objects. For > some reason only one show up. > What am I doing wrong ? > I've attached the jsp page. > thanks in advance > > > __________________________________ > Do you Yahoo!? > Yahoo! Calendar - Free online calendar with sync to > Outlook(TM). > http://calendar.yahoo.com> <%@ page contentType="text/html;charset=UTF-8" > language="java" import=diffent classes..." %> > <%@ taglib uri="/WEB-INF/struts-bean.tld" > prefix="bean" %> > <%@ taglib uri="/WEB-INF/struts-html.tld" > prefix="html" %> > <%@ taglib uri="/WEB-INF/struts-logic.tld" > prefix="logic" %> > <html:html locale="true"> > <% > ArrayList users = new ArrayList(); > UserProfile user1 = new > UserProfile("First1","Last1"); > users.add(user1); > UserProfile user2 = new > UserProfile("First2","Last2"); > users.add(user2); > request.setAttribute("usersAttrib",users); > > %> > <table border="1" width="100%"> > <tr> > <td>First name</td><td>Last Name</td> > </tr> > <logic:iterate id="usersAttrib" > name="usersAttrib" /> > <tr> > <td><bean:write name="usersAttrib" > property="firstName"/></td> > <td><bean:write name="usersAttrib" > property="lastName"/></td> > </tr> > </logic:iterate> > </table> > </html:html> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] _________________________________________________________ Do You Yahoo!? 流连网络世界的“你”是谁? http://cn.rd.yahoo.com/mail_cn/tag/?http://cn.surveys.yahoo.com/cn_user_profile_study_may2003 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]