首页>代码>ssh开发最简单的注解版增删改查,数据库在里面,分层清晰,供大家学习用>/Annoth/src/com/cuikaixuan/hp/annoth/action/AnnothAction.java
package com.cuikaixuan.hp.annoth.action;
import java.util.List;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import com.cuikaixuan.hp.annoth.entity.Annoth;
import com.cuikaixuan.hp.annoth.service.IAnnothService;
import com.opensymphony.xwork2.ActionSupport;
@Controller
@Scope("prototype")
@Namespace("/annoth")
@ParentPackage("struts-default")
public class AnnothAction extends ActionSupport {
@Autowired
private IAnnothService annothService;
private Annoth annoth;
private List list;
@Action(value="tooadd",results={
@Result(name="success",location="addannoth.jsp")
})
public String tooadd(){//去增加页面
return SUCCESS;
}
@Action(value="addAnnoth",results={
@Result(name="success",type="redirect",location="findall")
})
public String addAnnoth(){//增
this.annothService.addAnnoth(annoth);
return SUCCESS;
}
@Action(value="delAnnoth",results={
@Result(name="success",type="redirect",location="findall")
})
public String delAnnoth(){//删
this.annothService.delAnnoth(annoth);
return SUCCESS;
}
@Action(value="modifyAnnoth",results={
@Result(name="success",type="redirect",location="findall")
})
public String modifyAnnoth(){//改
this.annothService.modifyAnnoth(annoth);
return SUCCESS;
}
@Action(value="findall",results={
@Result(name="success",location="showannoth.jsp")
})
public String findall(){//查全部
list=this.annothService.findall();
return SUCCESS;
}
@Action(value="findbyid",results={
@Result(name="success",location="byidannoth.jsp")
})
public String findbyid(){//查单个
annoth=this.annothService.findbyid(annoth);
return SUCCESS;
}
public Annoth getAnnoth() {
return annoth;
}
public void setAnnoth(Annoth annoth) {
this.annoth = annoth;
}
public List getList() {
return list;
}
public void setList(List list) {
this.list = list;
}
}
最近下载更多
张真狗 LV9
2023年5月22日
小王wang LV10
2022年8月15日
uuuuuuuuuuuwwwwww LV3
2021年12月14日
dingyue LV2
2021年12月5日
漫长的白日梦 LV8
2021年12月4日
lsglsg9 LV23
2021年11月24日
yexiansheng LV1
2021年11月6日
GD_chan LV5
2021年7月20日
yu LV1
2021年6月24日
qweqweqwe7987987 LV1
2021年6月22日

最近浏览