这种方式能修改成功
<td align="right" >
<a href="javascript:document.getElementById('updateForm').submit();">保存</a>
<a href="javascript:window.history.back();">退回 </a>
</td>
</tr>
</table>
<br/>
<br>
<form id="updateForm" method="post" action="<%=request.getContextPath() %>/department/department_update?did=${update_department.did}" >
<%-- <input type="hidden" name="did" value="${update_department.did} "> --%>
<table style="font-size::16px">
<tr>
<td>部门名称:</td>
<td><input type="text" name="dname" value="${update_department.dname} "/></td>
</tr>
<tr>
<td>部门介绍:</td>
<td></td>
</tr>
<tr>
<td width="10%"></td>
<td>
<textarea cols="50" rows="5" name="ddesc">${update_department.ddesc}</textarea>
</td>
</tr>
</table>
这种范是修改失败,setId失败(setId不能使用String参数)
<a href="javascript:document.getElementById('updateForm').submit();">保存</a>
<a href="javascript:window.history.back();">退回 </a>
</td>
</tr>
</table>
<br/>
<br>
<form id="updateForm" method="post" action="<%=request.getContextPath() %>/department/department_update" >
<input type="hidden" name="did" value="${update_department.did} ">
<table style="font-size::16px">
<tr>
<td>部门名称:</td>
<td><input type="text" name="dname" value="${update_department.dname} "/></td>
</tr>
<tr>
<td>部门介绍:</td>
<td></td>
</tr>
<tr>
<td width="10%"></td>
<td>
<textarea cols="50" rows="5" name="ddesc">${update_department.ddesc}</textarea>
</td>
对应action如下
public String update(){
System.out.println(department.getDid());
System.out.println(department.getDname());
System.out.println(department.getDdesc());
//return NONE;
departmentService.update(department);
return "update_success";
}
这是什么原因???
sun 了 dog 了, value="${update_department.did} "中间有个空格,。。。。。。这问题绝对不会犯了
同样的方式在employee中两种方式都能成功,why?????
跳转
//部门修改跳转
public String updateUI(){
Department updateDepartment=departmentService.get(department.getDid());
request.setAttribute("update_department", updateDepartment);
return "updateUI";
}