📄 updatedepartmentaction.java
字号:
package com.wl.actionimpl;
import java.io.UnsupportedEncodingException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.wl.action.Action;
import com.wl.dao.DepartmentinfoDAO;
import com.wl.entity.Departmentinfo;
public class UpdateDepartmentAction implements Action {
public String doExcute(HttpServletRequest request,
HttpServletResponse response) {
try {
request.setCharacterEncoding("UTF-8");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String tid = request.getParameter("id");
int id = Integer.parseInt(tid);
String did = request.getParameter("departmentid");
String name = request.getParameter("departmentname");
Departmentinfo d = new Departmentinfo();
d.setId(id);
d.setDepartmentId(did);
d.setDepartmentName(name);
DepartmentinfoDAO dao = new DepartmentinfoDAO();
dao.updateDepartment(d);
return "departmentpage.do";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -