📄 petmastermanager.java
字号:
package com.pet.controller;
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.pet.actionform.MasterForm;
import com.pet.pojo.Petmaster;
import com.pet.proxy.PetmasterProxy;
public class PetmasterManager extends DispatchAction {
PetmasterProxy masterProxy;
public PetmasterProxy getMasterProxy() {
return masterProxy;
}
public void setMasterProxy(PetmasterProxy masterProxy) {
this.masterProxy = masterProxy;
}
public ActionForward add(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
MasterForm mf=(MasterForm)form;
Petmaster pm=new Petmaster(mf.getIdentityCard(),mf.getMasterId(),
mf.getMasterName(),mf.getMasterAddress(),
mf.getMasterTelephone(),null);
masterProxy.SaveMaster(pm);
request.setAttribute("msg", "主人信息记录保存成功!");
request.setAttribute("master", pm);
return mapping.findForward("ADD");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -