资源简介

该项目只涉及到两个实体类 Administer 和 Book ,两者之间没什么联系,不同Administer登陆之后看到的/操作的都是一样的book列表,业务很简单。另外该项目严格按照View-Service-Dao三层,所有对象(包括Action,Service,Dao,SessionFactory、Transaction等对象)都交由Spring容器来创建。

资源截图

代码片段和文件信息

package com.yx.action;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import com.yx.domain.Administer;
import com.yx.service.IAdministerService;

public class AdministerAction extends ActionSupport implements ModelDriven {
private IAdministerService administerService;
private Administer administer = new Administer();

public void setAdministerService(IAdministerService administerService) {
this.administerService = administerService;
}

public String login() {
//1.调用Service执行登录逻辑
Administer admin = administerService.getByCodePassword(administer);
//2.将返回的User对象放入session域
ActionContext.getContext().getSession().put(“administer“ admin);
//3.重定向到项目首页
return “toHome“;
}

@Override
public Administer getModel() {
// TODO Auto-generated method stub
return administer;
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        920  2018-06-11 21:16  SSHDemo\.classpath

     文件       1040  2018-06-11 08:12  SSHDemo\.project

     文件        567  2018-06-11 08:12  SSHDemo\.settings\.jsdtscope

     文件        364  2018-06-11 08:12  SSHDemo\.settings\org.eclipse.jdt.core.prefs

     文件        473  2018-06-11 08:12  SSHDemo\.settings\org.eclipse.wst.common.component

     文件        345  2018-06-11 08:12  SSHDemo\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2018-06-11 08:12  SSHDemo\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2018-06-11 08:12  SSHDemo\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件       5209  2018-06-12 19:56  SSHDemo\build\classes\applicationContext.xml

     文件       1542  2018-06-13 10:24  SSHDemo\build\classes\com\yx\action\AdministerAction.class

     文件       2733  2018-06-13 10:24  SSHDemo\build\classes\com\yx\action\BookAction.class

     文件        199  2018-06-13 10:24  SSHDemo\build\classes\com\yx\dao\IAdministerDao.class

     文件        420  2018-06-13 10:24  SSHDemo\build\classes\com\yx\dao\IBookDao.class

     文件       1697  2018-06-13 10:24  SSHDemo\build\classes\com\yx\dao\impl\AdministerDaoImpl$1.class

     文件       1001  2018-06-13 10:24  SSHDemo\build\classes\com\yx\dao\impl\AdministerDaoImpl.class

     文件       1433  2018-06-13 10:24  SSHDemo\build\classes\com\yx\dao\impl\BookDaoImpl$1.class

     文件       2338  2018-06-13 10:24  SSHDemo\build\classes\com\yx\dao\impl\BookDaoImpl.class

     文件       1064  2018-06-13 10:24  SSHDemo\build\classes\com\yx\domain\Administer.class

     文件        502  2018-06-11 18:32  SSHDemo\build\classes\com\yx\domain\Administer.hbm.xml

     文件       2177  2018-06-13 10:24  SSHDemo\build\classes\com\yx\domain\Book.class

     文件        599  2018-06-11 20:50  SSHDemo\build\classes\com\yx\domain\Book.hbm.xml

     文件        217  2018-06-13 10:24  SSHDemo\build\classes\com\yx\service\IAdministerService.class

     文件        494  2018-06-13 10:24  SSHDemo\build\classes\com\yx\service\IBookService.class

     文件       1310  2018-06-13 10:24  SSHDemo\build\classes\com\yx\service\impl\AdministerServiceImpl.class

     文件       2581  2018-06-13 10:40  SSHDemo\build\classes\com\yx\service\impl\BookServiceImpl.class

     文件       3356  2018-06-13 10:25  SSHDemo\build\classes\com\yx\test\MyTest.class

     文件        109  2018-06-11 17:33  SSHDemo\build\classes\db.properties

     文件       1716  2018-06-12 21:16  SSHDemo\build\classes\struts.xml

     文件       5209  2018-06-12 19:56  SSHDemo\src\applicationContext.xml

     文件        961  2018-06-11 18:27  SSHDemo\src\com\yx\action\AdministerAction.java

............此处省略93个文件信息

评论

共有 条评论