I am writing web application in struts 1.3. I want to pass ArrayList of Employees to JSP page.
I see following two approches :
1. Put List of Employee as a field into ActionForm.
List<Employee> employees;
Action class setting this field:
empForm.setEmployees(employeeList);
And JSP using this data as :
${empForm.employees}
2. Put the list of Employees directly into request.
Action class setting employeeList into request.
request.setAttribute("employees", employeeList);
And in JSP:
${employees}
Please suggest what approach should I go with. Which one is considered to be a good practice in Struts 1.3.