资源简介
SSH登录与增删改查demo详解+源代码
代码片段和文件信息
package com.mstf.action;
import java.util.List;
import com.mstf.bean.Info;
import com.mstf.service.InfoService;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
@SuppressWarnings(“serial“)
public class InfoAction extends ActionSupport implements ModelDriven{
//用于ModelDriven填充对象入口为getModel方法
private Info info;
//用于spring自动注入,入口为setInfoService方法
private InfoService infoService;
//方法名对应info_*.action中的*通配符
public String list() throws Exception{
//调用service方法,返回从数据库取出的数据
List infolist=infoService.getAll();
//放入session
ActionContext.getContext().put(“infolist“ infolist);
//返回视图,list对应struts.xml对应的jsp或action
return “list“;
}
public String addUI() throws Exception{
return “addUI“;
}
public String add() throws Exception{
infoService.save(info);
return “tolist“;
}
public String updateUI() throws Exception{
Info infos=infoService.getById(info.getId());
ActionContext.getContext().getValueStack().push(infos);
return “updateUI“;
}
public String update() throws Exception{
Info infos=infoService.getById(info.getId());
infos.setName(info.getName());
infos.setAge(info.getAge());
infos.setAddress(info.getAddress());
infoService.update(infos);
return “tolist“;
}
public String delete() throws Exception{
infoService.delete(info.getId());
return “tolist“;
}
@Override
public Info getModel() {
info =new Info();
return info;
}
public InfoService getInfoService() {
return infoService;
}
public void setInfoService(InfoService infoService) {
this.infoService = infoService;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-06-05 21:12 HSS\
文件 2676 2016-06-05 21:12 HSS\.classpath
文件 547 2016-06-05 21:12 HSS\src\log4j.properties
文件 282 2016-06-05 21:12 HSS\.myme
文件 1746 2016-06-05 21:12 HSS\.project
目录 0 2016-06-05 21:12 HSS\.settings\
文件 500 2016-06-05 21:12 HSS\.settings\.jsdtscope
文件 395 2016-06-05 21:12 HSS\.settings\org.eclipse.jdt.core.prefs
文件 447 2016-06-05 21:12 HSS\.settings\org.eclipse.wst.common.component
文件 252 2016-06-05 21:12 HSS\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2016-06-05 21:12 HSS\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2016-06-05 21:12 HSS\.settings\org.eclipse.wst.jsdt.ui.superType.name
目录 0 2016-06-05 21:23 HSS\WebRoot\
目录 0 2016-06-05 21:12 HSS\WebRoot\me
文件 36 2016-06-05 21:12 HSS\WebRoot\me
目录 0 2016-06-05 21:12 HSS\WebRoot\WEB-INF\
目录 0 2016-06-05 21:12 HSS\WebRoot\WEB-INF\classes\
文件 3999 2016-06-05 21:12 HSS\WebRoot\WEB-INF\classes\applicationContext.xm
目录 0 2016-06-05 21:12 HSS\WebRoot\WEB-INF\classes\com\
目录 0 2016-06-05 21:12 HSS\WebRoot\WEB-INF\classes\com\mstf\
目录 0 2016-06-05 21:12 HSS\WebRoot\WEB-INF\classes\com\mstf\action\
文件 2622 2016-06-05 21:12 HSS\WebRoot\WEB-INF\classes\com\mstf\action\InfoAction.class
文件 1838 2016-06-05 21:12 HSS\WebRoot\WEB-INF\classes\com\mstf\action\UserAction.class
目录 0 2016-06-05 21:12 HSS\WebRoot\WEB-INF\classes\com\mstf\bean\
文件 916 2016-06-05 21:12 HSS\WebRoot\WEB-INF\classes\com\mstf\bean\Bean.hbm.xm
文件 1078 2016-06-05 21:12 HSS\WebRoot\WEB-INF\classes\com\mstf\bean\Info.class
文件 2039 2016-06-05 21:12 HSS\WebRoot\WEB-INF\classes\com\mstf\bean\User.class
目录 0 2016-06-05 21:12 HSS\WebRoot\WEB-INF\classes\com\mstf\service\
文件 347 2016-06-05 21:12 HSS\WebRoot\WEB-INF\classes\com\mstf\service\InfoService.class
文件 187 2016-06-05 21:12 HSS\WebRoot\WEB-INF\classes\com\mstf\service\UserService.class
目录 0 2016-06-05 21:12 HSS\WebRoot\WEB-INF\classes\com\mstf\service\impl\
............此处省略67个文件信息
相关资源
- 基于SSH框架的仿当当网图书管理系统
- 基于SSH的订餐系统
- Spring+Struts2+hibernate+Redis整合
- 基于SSH框架的网上书店系统
- SSHStruts2+Spring+Hibernate三大框架整合简
- SSH整合员工管理系统
- 海思3516A 3516D openssl zlib openssh编译
-
SSH三大框架整合 struts2(使用xm
l配置 - 火车票订票系统(ssh)
- 学生选课系统SSH框架实现
- 基于Struts2电影网站
- SSH学生管理系统.
- 公交站系统有前后台
- 报到管理系统
- SSH进销存系统
- ssh框架实现论坛发帖,回帖 删除贴登
- SSH网上商城项目实战完整源码带博文
- ssh_employee
- SSH项目国税协同办公平台
- 基于SSH的医院在线挂号源码+数据库
- 网上商城完整源代码
- 用户登录注册项目-ssh框架
- 基于ssh的实现了摇号系统
- ssh框架项目国家税务管理系统
- SSH整合案例(个人博客)
- SSH整合登录+增删改查
- ssh实现注册
- SSH整合
- 吐血整理!grasshopper及其插件.rar
- ssh-patient.rar
评论
共有 条评论