No, it doesn't works, the problem seems to be the: <bean:write name="person" property="username" />
If i change person to person2 the errormessage change,too. so the error cannot be infront of <bean:write ! But why ist the bean not in any scope ? thanks Fredy -----Urspr�ngliche Nachricht----- Von: Ren� Eigenheer [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 23. Januar 2003 13:49 An: 'Struts Users Mailing List' Betreff: RE: How to iterate over Arraylist what do you use <jsp:useBean id="person" scope="request" class="de.hauschel.wapen.bt.vo.VOPerson"/> and not the standard struts (dyna)form? but if you realy need, maybe it works the following way: <jsp:useBean id="persons" scope="request"/> <logic:iterate id="person" type="de.hauschel.wapen.bt.vo.VOPerson" name="persons"> > -----Original Message----- > From: Softwareentwicklung Hauschel > [mailto:[EMAIL PROTECTED]] > Sent: Donnerstag, 23. Januar 2003 13:37 > To: Struts Users Mailing List > Subject: AW: How to iterate over Arraylist > > > That's really stupid ;-) > > But now there's the next error: > > I think the use Bean Tag is wrong, because the Error ist: > > Generated servlet error: > [javac] Compiling 1 source file > > C:\tomcatWapen\work\Standalone\localhost\wapen\form\listperson > s_jsp.java:92: > person is already defined in > _jspService(javax.servlet.http.HttpServletRequest,javax.servle > t.http.HttpSer > vletResponse) > java.lang.Object person = null; > ^ > > > But if i delete the use Bean Tag, then he says: > > org.apache.jasper.JasperException: Cannot find bean person in > any scope > > What is Tomcat's problem ? I think he don't know what he want ! > > thanks, Fredy > > > -----Urspr�ngliche Nachricht----- > Von: Nicolas De Loof [mailto:[EMAIL PROTECTED]] > Gesendet: Donnerstag, 23. Januar 2003 13:15 > An: Struts Users Mailing List > Betreff: Re: How to iterate over Arraylist > > > You just have to add at begining of your JSP : > > <%@ taglib uri="/WEB-INF/struts-loigc.tld" prefix="logic"%> > > Without that, you can see that logic:xx tags appears in > resulting HTML not > beeing interpreted by JSP parser. > > Nico. > > > My JSP: > > > > <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> > > <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> > > <jsp:useBean id="person" scope="request" > > class="de.hauschel.wapen.bt.vo.VOPerson"/> > > <html> > > <head> > > <title>Struts Form for listpersonsForm</title> > > </head> > > <body> > > > > <table border="1" width="100%"> > > <tr> > > <th align="center" width="30%"> �berschrigft </th> > > </tr> > > <logic:iterate id="person" name="persons" > > > <tr> > > <td align="left"> <bean:write name="person" > property="username" /> > > </td> > > </tr> > > </logic:iterate> > > </table> > > </html> > > > > My Action: > > public class ListpersonsAction extends WapenAction > > { > > public ActionForward execute( > > ActionMapping mapping, > > ActionForm form, > > HttpServletRequest request, > > HttpServletResponse response) > > throws Exception > > { > > Category cat = > > Category.getInstance( > > "de.hauschel.wapen.struts.action.ListpersonsAction"); > > > > cat.debug("->execute(mapping, form, request, response)"); > > > > ListpersonsForm listpersonsForm = (ListpersonsForm) form; > > > > ArrayList persons = new ArrayList(); > > > > BusinessDelegate bd = BusinessDelegate.getInstance(); > > persons.add( bd.getPerson( "fritz" ) ); > > persons.add( bd.getPerson( "fredy" ) ); > > > > cat.debug( "persons.size(): " + persons.size() ); > > > > request.setAttribute( "persons", persons ); > > > > cat.debug("<-execute(mapping, form, request, response)"); > > > > return mapping.findForward( SUCCESS ); > > } > > } > > > > My Problem: > > > > No usernames listed ! > > > > > > Output of Log4j: > > 23 Jan 03 12:46:04 DEBUG > > de.hauschel.wapen.struts.action.ListpersonsAction.execute > > (Line:57) - ->execute(mapping, form, request, response) > > 23 Jan 03 12:46:04 DEBUG > > de.hauschel.wapen.struts.action.ListpersonsAction.execute > (Line:67) - > > persons.size(): 2 > > 23 Jan 03 12:46:04 DEBUG > > de.hauschel.wapen.struts.action.ListpersonsAction.execute > (Line:71) - > > <-execute(mapping, form, request, response) > > > > > > -- > > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

