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

📄 familyservlet.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.vo.xy.FamilyInfoVo;

public class FamilyServlet extends HttpServlet {

	/**
	 * Constructor of the object.
	 */
	public FamilyServlet() {
		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 momName = request.getParameter("mname");	//母亲姓名
		String dadName = request.getParameter("fname");	//父亲姓名
		String mateName = request.getParameter("othername");	//配偶姓名
		String momVocation =request.getParameter("mjob");	//母亲职业
		String dadVocation = request.getParameter("fjob");	//父亲职业
		String mateVocation = request.getParameter("otherjob");	//配偶职业
		String childName = request.getParameter("childname");	//孩子姓名
		String childDegree = request.getParameter("childDegree");	//孩子学历
		String postcode = request.getParameter("postcode");//邮政编码
		String familyPhone = request.getParameter("phone");//家庭电话号码
		String position = request.getParameter("add");
		//创建Vo
		FamilyInfoVo familyvo = new FamilyInfoVo();
		familyvo.setMName(momName);
		familyvo.setFName(dadName);
		familyvo.setOtherName(mateName);
		familyvo.setMVocation(momVocation);
		familyvo.setFVocation(dadVocation);
		familyvo.setOtherVocation(mateVocation);
		familyvo.setChildName(childName);
		familyvo.setPostcode(postcode);
		familyvo.setPhone(familyPhone);
		familyvo.setChildDegree(childDegree);
		familyvo.setPosition(position);
		HttpSession session = request.getSession();
		session.setAttribute("familyVO", familyvo);
		request.getSession().setAttribute("edit", request.getSession().getAttribute("edit"));
		response.sendRedirect("../emp/awardInfoEdit.jsp");
		
		System.out.println("母亲名称:"+momName+"父亲名字:"+dadName+"配偶名字:"+mateName+"母亲职业:"+momVocation+"父亲职业:"+dadVocation+"配偶职业:"+mateVocation+childDegree);
	}
}

⌨️ 快捷键说明

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