0

I have a class Employees.java

public class EmployeesForm{
    private String name;
         ....
     public String[] getAllTypes() {
            String[] allTypes = new String[3];
            allTypes[0] = "Manager";
            allTypes[1] = "Dev";
            allTypes[2] = "FA";

        return allTypes; 
     }
}

In Struts1 this is how I iterate in allTypes array.

<logic:iterate id="type" name="employeesForm" property="allTypes">';
    <option value="<bean:write name=type>" id="typeid_<bean:write name='type'/>">
     <bean:write name="type"/>              
   </option>                        
</logic:iterate>

What is the equivalent in Struts2? I tried that but it didn't work :(

<s:iterator id="type" name="employeesForm" property="allTypes">
    <option value="<s:property value='type'/>" id="typeid_<s:property value='type'/>">
        <s:property value="type"/>
    </option>
</s:iterator>
Ariana
  • 283
  • 1
  • 6
  • 17

0 Answers0