Using sTRUTS lOGIC ItERATOR TAG
Posted on 2006-06-21
need an idea or suggestion..
say i have a class Employee which has its own get and set methods
and i have a class Role which has its own get and set methods
and i have a joining class Employee_Role which has Employee object and Role object and get and set methods for it..
Well i have a vector (as collection object)
since i need to display list of employees with their role names....
Employee id ------- Employee name ---- Employee role name
Now i want to use iterator .. i have vector in the same class with scope as "request"..
request.setAttribute("employee_role",employee_roles_vector); // From bean iam getting vector..Vice versa i can do there in bean itself....
<logic:iterate id="emp_role" property="employee_role" scope="request" type="supportingClasses.GetEmployees">
<html:text name="emp_role" property="mg_employee.id"/>
but iam getting org.apache.jasper.JasperException: Null attribute name
but i dont have any field as name..since employee has first_name and role has role_name..
Well anyway i want to figure out my understanding on Iterator first....
I mean if i have a collection of objects in an iterator where each object is its own type and to retrieve the object properties we simply need to iteate the collection object ...
if my understanding is right then is my code rght ???????????..
or the way iam doing is wrong... ?????????????????
Since iam a new bee iam trying to learn ..anyone's suggestion or advice would help me better...