Hey all,
does anybody knows a nice tutorial about iterating ?
I'm to stupid...
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]>