📄 workinfoservlet.java
字号:
package com.lovo.servlet.zhaobing;
import java.io.IOException;
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.lovo.bo.zhaobing.AwardInfoBo;
import com.lovo.vo.zhaobing.EmpVo;
import com.lovo.vo.zhaobing.WorkInfoVo;
public class WorkInfoServlet extends HttpServlet {
/**
* Constructor of the object.
*/
public WorkInfoServlet() {
super();
}
/**
* Destruction of the servlet. <br>
*/
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
}
/**
* The doGet method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to get.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request,response);
}
/**
* The doPost method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to post.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
request.setCharacterEncoding("utf-8");
HttpSession session = request.getSession();
EmpVo empVo =(EmpVo) session.getAttribute("empVo");
//获得用户填写的工作信息
String startTime = request.getParameter("start"); //进入公司时间
String position = request.getParameter("position");//职务
String department = request.getParameter("department"); //部门
String rank = request.getParameter("trade"); //级别
String workDescribe = request.getParameter("work"); //工作描述
String achievement = request.getParameter("outstanding"); //主要业绩
//创建Vo对象
WorkInfoVo workvo = new WorkInfoVo();
workvo.setStartTime(startTime);
workvo.setRank(rank);
workvo.setWorkDescribe(workDescribe);
workvo.setAchievement(achievement);
workvo.setDepartment(department);
workvo.setPosition(position);
workvo.setMyEmpPo(empVo);
session.setAttribute("workVo", workvo);
AwardInfoBo ado =new AwardInfoBo();
ado.WorkBo(workvo);
response.sendRedirect("../emp/employeeRegisterFamily.jsp");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -