日期:2014-05-17 浏览次数:20819 次
... public String updateUI() {
ActionContext.getContext().put("department", departmentService.find(dep_id));
return "add";
}...
<s:form action="manage_saveorupdate"
namespace="/department" method="get">
<s:token></s:token>
<s:hidden name="#department.dep_id" id="department.dep_id" />
部门名称:<s:textfield name="#department.dep_name" id="department.dep_name"/>
<br />
部门简称:<s:textfield name="#department.dep_shortname" id="department.dep_shortname"/>
<br />
<input type="submit" value="保存" />
</s:form>
private Department department;
public String updateUI() {
if (department == null) {
department = new Department();
}
department = departmentService.find(dep_id);
return "add";
}
public Department getDepartment() {
return department;
}
public void setDepartment(Department department) {
this.department = department;
}
<s:textfield id="dep_name" name="department.dep_name" ></s:textfield>