📄 addemployeeaction.java
字号:
package com.jspdev.ch17;import org.apache.struts.action.*;import javax.servlet.http.*;public class AddEmployeeAction extends Action { public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { /**@todo: complete the business logic here, this is just a skeleton.*/ EmployeeForm employeeForm = (EmployeeForm) actionForm; try { EmployeeBean bean=new EmployeeBean(); bean.addEmployee(employeeForm.getEmployee()); } catch(Exception e) { e.printStackTrace(); } httpServletRequest.setAttribute("employee",employeeForm.getEmployee()); return(actionMapping.findForward("employeeCreated")); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -