?? role1action.java
字號:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package gdpe.struts.action;
import gdpe.hibernate.auditor1.Auditor1;
import gdpe.hibernate.auditor1.Auditor1DAO;
import gdpe.hibernate.department.Department1;
import gdpe.hibernate.role.Role1;
import gdpe.hibernate.role.Role1DAO;
import gdpe.struts.form.Role1Form;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
/**
* MyEclipse Struts
* Creation date: 11-21-2007
*
* XDoclet definition:
* @struts.action path="/role1" name="role1Form" input="/role/role1.jsp" scope="request" validate="true"
*/
public class Role1Action extends Action {
/*
* Generated Methods
*/
/**
* Method execute
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
Role1Form role1Form = (Role1Form) form;// TODO Auto-generated method stub
String flag = request.getParameter("flag");
ActionErrors errors = new ActionErrors();
String target = "";
Role1DAO roDAO = new Role1DAO();
if (flag.equals("add")) {
target = "success";
Role1 au= new Role1();
au.setChrolecode(role1Form.getCHROLECODE());
au.setChrolename(role1Form.getCHROLENAME());
au.setChroledesc(role1Form.getCHROLEDESC());
System.out.println("role------->");
roDAO.save(au);
ActionError err=new ActionError("errors.auditSuccess");
errors.add("addAuditorsuccess",err);
saveErrors(request,errors);
return (mapping.findForward(target));
}
return null;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -