我有一个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;
}
}
在Struts1中,这是我在allTypes数组中迭代的方式。
<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>
Struts2中的等价物是什么?我试过了,但它没有用:(
<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>