/**
*Author: Mr Luo
*Email:suibian1990@hotmail.com
*DateTime:2012-6-4 上午9:33:50
*Version:Vacate_02
*/
package edu.ljm.vacate.action;
import java.util.Map;
import javax.annotation.Resource;
import org.apache.struts2.interceptor.SessionAware;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import com.opensymphony.xwork2.ActionSupport;
import edu.ljm.vacate.model.Student;
import edu.ljm.vacate.model.Teacher;
import edu.ljm.vacate.service.StudentService;
import edu.ljm.vacate.service.TeacherService;
@Component("loginAction")
@Scope("prototype")
public class LoginAction extends ActionSupport implements SessionAware{
private String username;
private String password;
private String userType;
private Teacher teacher;
private Student student;
private Map<String, Object> session;
private TeacherService teacherService;
private StudentService studentService;
public String logout() {
session.clear();
return "logout";
}
public String login() {
if(userType.equals("teacher")){
teacher = new Teacher(username,password);
Teacher t = teacherService.getTeacher(teacher);
if(t != null) {
if(t.getPassword().equals(teacher.getPassword()))
{
teacher = t;
this.session.put("username",teacher.getTeacherId());
this.session.put("teacher",teacher);
return "logteacher";
}
this.addFieldError("password", "* 密码输入错误!");
return INPUT;
}
this.addFieldError("username", "* 用户名不存在!");
return INPUT;
} else {
student = new Student(username,password);
Student s = studentService.getStudent(student);
if(s != null) {
if(s.getPassword().equals(student.getPassword()))
{
student = s;
this.session.put("username",student.getStudentId());
this.session.put("student", student);
return "logstudent";
}
this.addFieldError("password", "* 密码输入错误!");
return INPUT;
}
this.addFieldError("username", "* 用户名不存在!");
return INPUT;
}
}
public String loginOut() {
this.session.remove("username");
return "logout";
}
public String getUsername() {
return username;
}
public String getPassword() {
return password;
}
public String getUserType() {
return userType;
}
public Teacher getTeacher() {
return teacher;
}
public Student getStudent() {
return student;
}
public TeacherService getTeacherService() {
return teacherService;
}
public StudentService getStudentService() {
return studentService;
}
public void setUsername(String username) {
this.username = username;
}
public void setPassword(String password) {
this.password = password;
}
public void setUserType(String userType) {
this.userType = userType;
}
public void setTeacher(Teacher teacher) {
this.teacher = teacher;
}
public void setStudent(Student student) {
this.student = student;
}
@Resource(name="teacherService")
public void setTeacherService(TeacherService teacherService) {
this.teacherService = teacherService;
}
@Resource(name="studentService")
public void setStudentService(StudentService studentService) {
this.studentService = studentService;
}
public Map<String, Object> getSession() {
return session;
}
public void setSession(Map<String, Object> session) {
this.session = session;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
基于SSH框架的请假系统
共419个文件
gif:260个
class:36个
jar:36个
4星 · 超过85%的资源 需积分: 12 36 下载量 152 浏览量
2012-06-09
08:52:14
上传
评论 3
收藏 14.94MB RAR 举报
温馨提示
这是一个基于Strut2、Hibernate3.2、Spring2.5.6的一个简单的请假系统,功能丰富,界面简单方便,采用SQLserver2008数据库,里面含有数据库的代码
资源推荐
资源详情
资源评论
收起资源包目录
基于SSH框架的请假系统 (419个子文件)
VacateReplyAction.class 5KB
LoginAction.class 4KB
ReplyAction.class 3KB
VacateAction.class 3KB
VacateReply.class 3KB
VacateReplyDaoImpl.class 2KB
StudentDaoImpl.class 2KB
Student.class 2KB
Vacate.class 2KB
Reply.class 2KB
Teacher.class 2KB
VacateReplyServiceImpl.class 2KB
VacateDaoImpl.class 2KB
VacateActionTest.class 2KB
ReplyActionTest.class 1KB
VacateReplyActionTest.class 1KB
TeacherDaoImpl.class 1KB
VacateServiceImpl.class 1KB
StudentServiceImpl.class 1KB
ReplyDaoImpl.class 1KB
TeacherServiceImplTest.class 1KB
ReplyServiceImpl.class 1KB
TeacherServiceImpl.class 1KB
StudentAction.class 1KB
StudentActionTest.class 918B
LoginActionTest.class 524B
VacateReplyService.class 511B
VacateReplyDao.class 499B
StudentService.class 296B
StudentDao.class 284B
VacateService.class 250B
VacateDao.class 238B
TeacherService.class 218B
TeacherDao.class 206B
ReplyService.class 196B
ReplyDao.class 184B
.classpath 965B
org.eclipse.wst.common.component 544B
org.eclipse.wst.jsdt.ui.superType.container 49B
css.css 16KB
style.css 11KB
head.css 6KB
control.css 5KB
common1.css 4KB
style0.css 1KB
welcome.gif 164KB
welcome.gif 164KB
welcome.gif 164KB
welcome.gif 164KB
top03.gif 10KB
top03.gif 10KB
top03.gif 10KB
top03.gif 10KB
ico15.gif 8KB
ico15.gif 8KB
ico15.gif 8KB
ico15.gif 8KB
ico14.gif 8KB
ico14.gif 8KB
ico14.gif 8KB
ico14.gif 8KB
ico16.gif 8KB
ico16.gif 8KB
ico16.gif 8KB
ico16.gif 8KB
ico13.gif 7KB
ico13.gif 7KB
ico13.gif 7KB
ico13.gif 7KB
pic05.gif 5KB
pic05.gif 5KB
pic05.gif 5KB
pic05.gif 5KB
bu13.gif 4KB
bu13.gif 4KB
bu13.gif 4KB
bu13.gif 4KB
bu10.gif 4KB
bu10.gif 4KB
bu10.gif 4KB
bu10.gif 4KB
nav03.gif 4KB
nav03.gif 4KB
nav03.gif 4KB
nav03.gif 4KB
nav01.gif 4KB
nav01.gif 4KB
nav01.gif 4KB
nav01.gif 4KB
bu09.gif 4KB
bu09.gif 4KB
bu09.gif 4KB
bu09.gif 4KB
bu07.gif 4KB
bu07.gif 4KB
bu07.gif 4KB
bu07.gif 4KB
bu04.gif 4KB
bu04.gif 4KB
bu04.gif 4KB
共 419 条
- 1
- 2
- 3
- 4
- 5
资源评论
- longgecaihua2014-10-04个人觉得可以,下载之后自己修改了。。。
- CarsonT_T2012-06-12一个小的请假系统!个人觉得不好!
- a18240712018-03-27为什么我下载的是空的
Logic_Luo
- 粉丝: 20
- 资源: 73
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Screenshot_20240427_031602.jpg
- 网页PDF_2024年04月26日 23-46-14_QQ浏览器网页保存_QQ浏览器转格式(6).docx
- 直接插入排序,冒泡排序,直接选择排序.zip
- 在排序2的基础上,再次对快排进行优化,其次增加快排非递归,归并排序,归并排序非递归版.zip
- 实现了7种排序算法.三种复杂度排序.三种nlogn复杂度排序(堆排序,归并排序,快速排序)一种线性复杂度的排序.zip
- 冒泡排序 直接选择排序 直接插入排序 随机快速排序 归并排序 堆排序.zip
- 课设-内部排序算法比较 包括冒泡排序、直接插入排序、简单选择排序、快速排序、希尔排序、归并排序和堆排序.zip
- Python排序算法.zip
- C语言实现直接插入排序、希尔排序、选择排序、冒泡排序、堆排序、快速排序、归并排序、计数排序,并带图详解.zip
- 常用工具集参考用于图像等数据处理
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功