资源简介
SSH 整合实现增删改查
代码片段和文件信息
package com.cqvie.action;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.interceptor.RequestAware;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import com.cqvie.model.Department;
import com.cqvie.model.Employee;
import com.cqvie.service.DepartmentService;
import com.cqvie.service.EmployeeService;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import com.opensymphony.xwork2.Preparable;
@Component(“employeeAction“)
@Scope(“prototype“)
public class EmployeeAction extends ActionSupport implements ModelDriven RequestAware Preparable {
private static final long serialVersionUID = 1L;
private Mapject> request;
private Employee emp = new Employee();
private EmployeeService employeeService;
private DepartmentService departmentService;
private InputStream inputStream;
public Employee getEmp() {
return emp;
}
public void setEmp(Employee emp) {
this.emp = emp;
}
public EmployeeService getEmployeeService() {
return employeeService;
}
@Resource
public void setEmployeeService(EmployeeService employeeService) {
this.employeeService = employeeService;
}
public DepartmentService getDepartmentService() {
return departmentService;
}
@Resource
public void setDepartmentService(DepartmentService departmentService) {
this.departmentService = departmentService;
}
public Mapject> getRequest() {
return request;
}
public void setRequest(Mapject> request) {
this.request = request;
}
public InputStream getInputStream() {
return inputStream;
}
public void setInputStream(InputStream inputStream) {
this.inputStream = inputStream;
}
@Override
public Employee getModel() {
return emp;
}
/**
* 修改用户时获得该 UUID
*/
ActionContext context = ActionContext.getContext();
HttpServletRequest req = (HttpServletRequest) context.get(ServletActionContext.HTTP_REQUEST);
String e_uuid = req.getParameter(“e_uuid“);
/**
* 获得所有员工的信息
* @return
*/
public String list() {
List employees = employeeService.getAllEmployee();
request.put(“employees“ employees);
return “list“;
}
/**
* 跳转到修改、增加界面
*/
public String input() {
List departments = departmentService.getAllDepartment();
request.put(“departments“ departments);
return “input“;
}
/**
* 修改界面的显示当前信息
*/
public void prepareInput() {
System.err.println(“*******“ + e_uuid + “********“);
if(e_uuid != null) {
emp = employeeService.getEmployee(e_uuid)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-04-11 08:25 SSH_170331\
文件 884 2017-03-31 11:43 SSH_170331\.classpath
文件 1043 2017-03-31 15:53 SSH_170331\.project
目录 0 2017-04-11 08:25 SSH_170331\.settings\
文件 567 2017-03-31 11:41 SSH_170331\.settings\.jsdtscope
文件 364 2017-03-31 11:41 SSH_170331\.settings\org.eclipse.jdt.core.prefs
文件 557 2017-03-31 15:53 SSH_170331\.settings\org.eclipse.wst.common.component
文件 345 2017-03-31 11:41 SSH_170331\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2017-03-31 11:41 SSH_170331\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2017-03-31 11:41 SSH_170331\.settings\org.eclipse.wst.jsdt.ui.superType.name
目录 0 2017-04-11 08:25 SSH_170331\build\
目录 0 2017-04-11 08:25 SSH_170331\build\classes\
文件 3486 2017-03-31 11:53 SSH_170331\build\classes\applicationContext.xm
目录 0 2017-04-11 08:25 SSH_170331\build\classes\com\
目录 0 2017-04-11 08:25 SSH_170331\build\classes\com\cqvie\
目录 0 2017-04-11 08:25 SSH_170331\build\classes\com\cqvie\action\
文件 6190 2017-04-06 10:04 SSH_170331\build\classes\com\cqvie\action\EmployeeAction.class
文件 1453 2017-04-06 10:17 SSH_170331\build\classes\com\cqvie\action\EmployeeActionTest.class
文件 3256 2017-04-06 10:05 SSH_170331\build\classes\com\cqvie\action\LoginAction.class
文件 2018 2017-04-01 09:48 SSH_170331\build\classes\com\cqvie\action\LoginActionTest.class
目录 0 2017-04-11 08:25 SSH_170331\build\classes\com\cqvie\converters\
文件 1323 2017-04-01 18:53 SSH_170331\build\classes\com\cqvie\converters\SSHDateConverter.class
文件 52 2017-04-01 18:52 SSH_170331\build\classes\com\cqvie\converters\xwork-conversion.properties
目录 0 2017-04-11 08:25 SSH_170331\build\classes\com\cqvie\dao\
文件 376 2017-04-06 10:08 SSH_170331\build\classes\com\cqvie\dao\DepartmentDao.class
文件 504 2017-04-06 10:09 SSH_170331\build\classes\com\cqvie\dao\EmployeeDao.class
目录 0 2017-04-11 08:25 SSH_170331\build\classes\com\cqvie\dao\impl\
文件 2116 2017-04-01 18:06 SSH_170331\build\classes\com\cqvie\dao\impl\DepartmentDaoImpl.class
文件 3061 2017-04-06 10:11 SSH_170331\build\classes\com\cqvie\dao\impl\EmployeeDaoImpl.class
目录 0 2017-04-11 08:25 SSH_170331\build\classes\com\cqvie\model\
文件 981 2017-04-01 09:13 SSH_170331\build\classes\com\cqvie\model\Department.class
............此处省略104个文件信息
相关资源
- ssh框架 个人博客 系统
- 基于SSH的B2C购物网站源代码
- ssh_crm客户关系管理系统
- ssh框架开发的个人博客系统前后台
- SSH登录与增删改查demo详解+源代码
- 基于SSH框架的仿当当网图书管理系统
- crud(maven+ssm)可在多种ide上运行
- 基于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框架项目国家税务管理系统
评论
共有 条评论