Example:
DataBean:
public class EmployeeBean(){
private String name = null;
Private String dept = null;
... Getters and setters
}
FormBean:
public class EmployeeForm extends ActionForm{
private Collection employees = new ArrayList();
... Getters and Setters
}
ActionClass:
public ActionForward execute(final ActionMapping mapping,
final ActionForm form,
final HttpServletRequest request,
final HttpServletResponse response) {
EmployeeForm empForm = (EmployeeForm) form;
//getEmployeesFromDatabase should return a collection of EmployeeBeans
empForm.setEmployees(getEmployeesFromDatabase());
return mapping.findForward("display");
}
JSP:
<table>
<tr><th>Name</th>
<th>Dept</th>
<html:form action="xyz" method="post">
<logic:iterate id="emp" name="EmployeeForm" property="employees">
<tr><td><html:text property="name"/></td>
<td><html:text property="dept"/></td>
</tr>
</logic:iterate>
</html:form>
--------------------------------------------------------
People are conversing... without posting their email or filling
up their mail box. roomity.com http://roomity.com/launch.jsp No sign up to read
or search this Rich Internet App
~~1122996240050~~
--------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]