📄 movestaff.java
字号:
package com.action.staff;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.service.StaffManager;
import com.service.impl.StaffManagerImpl;
//根据员工ID与职位ID移动
public class MoveStaff extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request,response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
HttpSession ss = request.getSession();
String[] staffId = (String[])ss.getAttribute("staff");
ss.removeAttribute("staff");
String positionId = request.getParameter("positionId");
StaffManager manager = new StaffManagerImpl();
manager.moveStaff(staffId, positionId);
RequestDispatcher rd = request.getRequestDispatcher("/return.jsp");
rd.forward(request, response);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -