⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 awardinfoservlet.java

📁 办公自动化系统,有人事资源管理模块,考勤管理,审批管理,权限设定等.
💻 JAVA
字号:
package com.lovo.servlet.xy;

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.xy.EmpBo;

import com.lovo.po.xy.EmpPo;
import com.lovo.vo.xy.AwardInfoVo;
import com.lovo.vo.xy.EmpVo;
import com.lovo.vo.xy.FamilyInfoVo;
import com.lovo.vo.xy.WorkInfoVo;

public class AwardInfoServlet extends HttpServlet {

	/**
	 * Constructor of the object.
	 */
	public AwardInfoServlet() {
		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");
		//String button = request.getParameter("submit");
		
		AwardInfoVo awVo = new AwardInfoVo();
		//if(button.equals("确定")){
			String award = request.getParameter("award");	//奖励信息
			String punishment = request.getParameter("punishment");	//惩罚信息
			System.out.println("奖励信息:"+award +"   "+"惩罚信息:"+punishment);
			
			awVo.setAward(award);
			awVo.setPunishment(punishment);
		//}
		//if(button.equals("保存")){
			HttpSession session = request.getSession();
			//获得基本信息
			EmpBo awbo = new EmpBo();
			
			EmpVo empvo=(EmpVo) session.getAttribute("empVo");
			
			awbo.EmployBo(empvo);
			System.out.println(empvo.getName());
//			EmpPo  emppo  = new EmpPo();
//			emppo.getId();
			//获得工作信息
			WorkInfoVo workvo = (WorkInfoVo) session.getAttribute("workvo");
			awbo.WorkBo(workvo, empvo);
			//获得家庭信息
			FamilyInfoVo familyvo = (FamilyInfoVo) session.getAttribute("familyVO");
			awbo.FamilyInfoBo(familyvo,empvo);
			//获得填写的奖惩信息
			
			awbo.AwardBo(awVo,empvo);
			session.setAttribute("awvo", awVo);
			response.sendRedirect("../emp/ok.jsp");
		//}
		
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -