67,538
社区成员
发帖
与我相关
我的任务
分享<action name="list" class="employeeBean" method="list">
<result name="list_page">/ext_list.jsp</result>
<result name="input">/ext_add.jsp</result>
</action>
<action name="add" class="employeeBean" method="add">
<result name="suc" type="redirectAction">list</result>
<result name="input">/ext_add.jsp</result>
</action>// action
public String add() {
if (null == this.employee || this.employeeManager.getEmployee(employee.getName(),
employee.getPhone()) != null) {
return INPUT;
} else {
this.employeeManager.addEmployee(employee);
return "suc";
}
}
public String list() {
this.employees = this.employeeManager.listEmployee();
this.employeesjson = net.sf.json.JSONArray.fromObject(employees).toString();
if (this.employees.size() > 0) {
System.out.println("进入list方法");
return "list_page";
} else {
return INPUT;
}
}
