首页>代码>SSH+JSP+MYSQL(spring4.2.4+struts2.3.24+hibernate4.1.7)用户登录以及简单增删查改的网站实例>/ssh_demo/src/com/action/UpdateAction.java
package com.action;
import com.entity.Custom;
import com.opensymphony.xwork2.Action;
import com.service.CustomService;
public class UpdateAction implements Action {
private CustomService customService;
private Custom custom;
private int cid;
public Custom getCustom() {
return custom;
}
public void setCustom(Custom custom) {
this.custom = custom;
}
public CustomService getCustomService() {
return customService;
}
public void setCustomService(CustomService customService) {
this.customService = customService;
}
public int getCid() {
return cid;
}
public void setCid(int cid) {
this.cid = cid;
}
@Override
public String execute() throws Exception {
if(customService.findCustomById(custom.getCid()) != null) //如果存在该id:
{
customService.updateCustom(custom);
return "SUCCESS";
}
return "INPUT";
}
}
最近下载更多
星辰xc LV2
2023年5月7日
彩色天空 LV5
2023年4月8日
fengshengtian LV8
2022年2月19日
839749683 LV9
2021年12月21日
erqian LV1
2021年6月21日
1973356987 LV13
2021年6月16日
zdm_3366 LV3
2021年1月18日
lovemyhome LV5
2021年1月2日
wob_ku LV6
2020年7月4日
昵称zzz LV13
2020年7月3日

最近浏览