package com.action; import java.util.List; import java.util.Map; import org.apache.struts2.ServletActionContext; import com.dao.TAdminDAO; import com.model.TAdmin; import com.opensymphony.xwork2.ActionSupport; public class adminAction extends ActionSupport { private int userId; private String userName; private String userPw; private String message; private String path; private int index=1; private TAdminDAO adminDAO; public String adminAdd() { TAdmin admin=new TAdmin(); admin.setUserName(userName); admin.setUserPw(userPw); adminDAO.save(admin); this.setMessage("²Ù×÷³É¹¦"); this.setPath("adminManage.action"); return "succeed"; } public String adminManage() { List adminList=adminDAO.findAll(); Map request=(Map)ServletActionContext.getContext().get("request"); request.put("adminList", adminList); return ActionSupport.SUCCESS; } public String adminDel() { adminDAO.delete(adminDAO.findById(userId)); this.setMessage("ɾ³ý³É¹¦"); this.setPath("adminManage.action"); return "succeed"; } public TAdminDAO getAdminDAO() { return adminDAO; } public void setAdminDAO(TAdminDAO adminDAO) { this.adminDAO = adminDAO; } public String getMessage() { return message; } public int getIndex() { return index; } public void setIndex(int index) { this.index = index; } public void setMessage(String message) { this.message = message; } public String getPath() { return path; } public void setPath(String path) { this.path = path; } public int getUserId() { return userId; } public void setUserId(int userId) { this.userId = userId; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getUserPw() { return userPw; } public void setUserPw(String userPw) { this.userPw = userPw; } }

skook7 LV2
2024年5月27日
微信网友_6508798513811456 LV5
2023年6月17日
zzw123zzw LV6
2022年10月28日
zhaoyangwfd LV17
2022年10月11日
srl2881552 LV10
2022年9月6日
地上有草 LV12
2022年5月11日
wanglinddad LV55
2022年3月8日
encoun LV3
2022年1月5日
形水灯 LV4
2021年11月8日
lsc860911 LV11
2021年6月2日

hawkzl LV2
4月2日
微信网友_7391151377240064
2月19日
暂无贡献等级
kiel22 LV2
2024年12月25日
anjuw521 LV1
2024年7月11日
刘昊然 LV1
2024年7月1日
wangbh1234 LV1
2024年6月6日
denliv_hui LV14
2024年5月28日
huott1993 LV1
2024年4月6日
WBelong LV8
2024年3月5日
263648 LV7
2023年12月28日