• 大小: 11.66MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-06-18
  • 语言: Java
  • 标签: struts2  spring  hibernate  SSH  

资源简介

笔者开发时所用到的软件: apache-tomcat-7.0.25.exe eclipse-jee-indigo-SR2-win32.zip mysql-5.5.20-win32.msi navicat100_mysql_en.zip jdk-6u22-windows-i586.exe SSH的版本: struts-2.3.1.2 spring-framework-3.1.1.RELEASE hibernate-distribution-3.6.10.Final 开发环境搭建后:在MySQL数据库中新建数据库xsgl,然后执行xsgl.sql中的语句,打开Eclipse,导入StudentSSH项目,部署项目,在浏览器器中运行login.jsp,用户名admin,密码admin,进入首页后可对学生、教师、课程进行增删改查。 适合于初学Struts2+Spring+Hibernate的开发人员参考学习。

资源截图

代码片段和文件信息

package action;

import service.CourseService;
import bean.Course;

import com.opensymphony.xwork2.ActionSupport;

public class AddCourse extends ActionSupport {
/**
 * 
 */
private static final long serialVersionUID = 1L;
private Course course;
private CourseService courseService;

public Course getCourse() {
return course;
}

public void setCourse(Course course) {
this.course = course;
}

public CourseService getCourseService() {
return courseService;
}

public void setCourseService(CourseService courseService) {
this.courseService = courseService;
}

public static long getSerialversionuid() {
return serialVersionUID;
}

@Override
public String execute() throws Exception {
// TODO Auto-generated method stub
try {
courseService.addCourse(course);
return SUCCESS;
} catch (Exception e) {
e.printStackTrace();
return ERROR;
}
}

@Override
public void validate() {
// TODO Auto-generated method stub
if (null == course.getCid() || ““.equals(course.getCid())) {
addFieldError(“course.cid“ “请输入课程号“);
}
if (null == course.getCname() || ““.equals(course.getCname())) {
addFieldError(“course.cname“ “请输入课程名“);
}
if (null == course.getKkxq() || ““.equals(course.getKkxq())) {
addFieldError(“course.kkxq“ “请输入开课学期“);
}
if (null == course.getXs() || ““.equals(course.getXs())) {
addFieldError(“course.xs“ “请输入课程学时“);
}
if (null == course.getXf() || ““.equals(course.getXf())) {
addFieldError(“course.xf“ “请输入课程学分“);
}
}

}

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

     文件        834  2012-06-06 08:50  StudentSSH\.classpath

     文件       1043  2012-06-06 08:50  StudentSSH\.project

     文件        503  2012-06-06 08:50  StudentSSH\.settings\.jsdtscope

     文件        364  2012-06-06 08:50  StudentSSH\.settings\org.eclipse.jdt.core.prefs

     文件        484  2012-06-06 08:50  StudentSSH\.settings\org.eclipse.wst.common.component

     文件        345  2012-06-06 08:50  StudentSSH\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2012-06-06 08:50  StudentSSH\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2012-06-06 08:50  StudentSSH\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件       2065  2012-06-06 08:55  StudentSSH\build\classes\action\AddCourse.class

     文件       1874  2012-06-06 08:55  StudentSSH\build\classes\action\AddStudent.class

     文件       1781  2012-06-06 08:55  StudentSSH\build\classes\action\AddTeacher.class

     文件       1324  2012-06-06 08:55  StudentSSH\build\classes\action\DeleteCourse.class

     文件       1341  2012-06-06 08:55  StudentSSH\build\classes\action\DeleteStudent.class

     文件       1450  2012-06-06 08:55  StudentSSH\build\classes\action\DeleteTeacher.class

     文件       2037  2012-06-06 08:55  StudentSSH\build\classes\action\Login.class

     文件       1402  2012-06-06 08:55  StudentSSH\build\classes\action\ModifyCourse.class

     文件       2080  2012-06-06 08:55  StudentSSH\build\classes\action\ModifyCourse1.class

     文件       1421  2012-06-06 08:55  StudentSSH\build\classes\action\ModifyStudent.class

     文件       1889  2012-06-06 08:55  StudentSSH\build\classes\action\ModifyStudent1.class

     文件       1421  2012-06-06 08:55  StudentSSH\build\classes\action\ModifyTeacher.class

     文件       1796  2012-06-06 08:55  StudentSSH\build\classes\action\ModifyTeacher1.class

     文件       1563  2012-06-06 08:55  StudentSSH\build\classes\action\ViewCourses.class

     文件       1580  2012-06-06 08:55  StudentSSH\build\classes\action\ViewStudents.class

     文件       1580  2012-06-06 08:55  StudentSSH\build\classes\action\ViewTeachers.class

     文件        887  2012-06-06 08:55  StudentSSH\build\classes\bean\Admin.class

     文件       1412  2012-06-06 08:55  StudentSSH\build\classes\bean\Course.class

     文件        555  2012-06-06 08:52  StudentSSH\build\classes\bean\Course.hbm.xml

     文件       1072  2012-06-06 08:55  StudentSSH\build\classes\bean\Student.class

     文件        486  2012-06-06 08:52  StudentSSH\build\classes\bean\Student.hbm.xml

     文件        881  2012-06-06 08:55  StudentSSH\build\classes\bean\Teacher.class

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

评论

共有 条评论