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

📄 savehraction.java

📁 本人课程设计时做的一个用struts框架实现的基于cmmi2的项目管理系统的原型。还有部分功能尚未实现
💻 JAVA
字号:
// Created by Xslt generator for Eclipse.// XSL :  not found (java.io.FileNotFoundException:  (The system cannot find the path specified))// Default XSL used : easystruts.jar$org.easystruts.xslgen.JavaClass.xslpackage com.cmmi2pms.pp.hr;import	com.cmmi2pms.common.Constants;import  com.cmmi2pms.sa.project.Project;import java.io.IOException;import javax.servlet.ServletException;import javax.servlet.http.HttpSession;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import org.apache.struts.action.Action;import org.apache.struts.action.ActionForm;import org.apache.struts.action.ActionForward;import org.apache.struts.action.ActionMapping;import org.apache.log4j.Logger;/**  * AdduserAction.java created by EasyStruts - XsltGen. * http://easystruts.sf.net * created on 04-12-2004 *  * XDoclet definition: * @struts:action path="/addproject" name="addProjectForm" input="/pages/SA/project/addproject.jsp" validate="true" * @struts:action-forward name="/pages/failure.htm" path="/pages/failure.htm" redirect="true" * @struts:action-forward name="/pages/success.htm" path="/pages/success.htm" redirect="true" */public class SaveHrAction extends Action {	// --------------------------------------------------------- Instance Variables	// --------------------------------------------------------- Methods	/** 	 * Method execute	 * @param ActionMapping mapping	 * @param ActionForm form	 * @param HttpServletRequest request	 * @param HttpServletResponse response	 * @return ActionForward	 * @throws Exception	 */	private static Logger logger = Logger.getLogger ("AddHrAction") ;	 	public ActionForward perform(ActionMapping mapping,			ActionForm form,			HttpServletRequest request,			HttpServletResponse response)	throws IOException, ServletException {				logger.info("add hr is called");						HrForm theHrForm = (HrForm) form;		Hr newHr = new Hr();				int projectid =100;		try{			Project theProject = new Project();			theProject = (Project) request.getSession().getAttribute(Constants.PROJECT_KEY);			projectid = Integer.parseInt( theProject.getProjectID() );		}		catch (Exception e){			System.out.println("Exception is throwed from getProjectID:"+e.getMessage());		}				logger.info("-----添加项目成员" + theHrForm.getUser());		newHr.createHr(theHrForm,projectid);		logger.info("添加用户:" + theHrForm.getUser() + "成功");				//newUser.getUserInfor(theUserForm.getUserID());				//HttpSession session = request.getSession();		//session.setAttribute("userInfor", newUser);				return (mapping.findForward("SUCCESS"));		//throw new UnsupportedOperationException("Generated method 'execute(...)' not implemented.");	}		}

⌨️ 快捷键说明

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