📄 adduseraction.java
字号:
/**
* AddUserAction
*
* @author Jerry Shen
* @version v 1.0 June 20th, 2008
* ---------------------------------------------------------------------------
* @History
*/
package com.cognizant.food.action;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;
import com.cognizant.food.form.UserForm;
import com.cognizant.food.service.UserService;
public class AddUserAction extends DispatchAction {
private UserService userService;
public UserService getUserService() {
return userService;
}
public void setUserService(UserService userService) {
this.userService = userService;
}
public ActionForward execute(ActionMapping mapping,ActionForm form,
HttpServletRequest request,HttpServletResponse response) {
try {
UserForm uForm = (UserForm) form;
userService.addUser(uForm.getBo());
return mapping.findForward("go");
}catch (Exception e) {
return mapping.findForward("loop");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -