• 大小: 2.31MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-23
  • 语言: 其他
  • 标签: ssh  javaee  

资源简介

基于SSH开发的学生选课系统,完整功能,适合初学者研究学习。

资源截图

代码片段和文件信息

package action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import models.Admin;
import models.Course;
import models.Course_teacher;
import models.Student;
import models.Teacher;

import org.apache.struts2.ServletActionContext;

import service.IAdminService;

import com.opensymphony.xwork2.ActionContext;

public class AdminAction {
private IAdminService adminservice;
private HttpServletRequest request;
private Teacher newteacher;

public Teacher getNewteacher() {
return newteacher;
}

public void setNewteacher(Teacher newteacher) {
this.newteacher = newteacher;
}
    private Admin newadmin;
    private Student newstudent;
    private Course newcourse;
    public Course getNewcourse() {
return newcourse;
}

public void setNewcourse(Course newcourse) {
this.newcourse = newcourse;
}

public Student getNewstudent() {
return newstudent;
}

public void setNewstudent(Student newstudent) {
this.newstudent = newstudent;
}


public Admin getNewadmin() {
return newadmin;
}

public void setNewadmin(Admin newadmin) {
this.newadmin = newadmin;
}

public IAdminService getAdminservice() {
return adminservice;
}

public void setAdminservice(IAdminService adminservice) {
this.adminservice = adminservice;
}

public String execute() {
ActionContext.getContext().getSession().put(“admin“ newadmin);
if(adminservice.updateAdminInfo(newadmin)){
return “success“;
}
else
return “false“;
}

public String showallstuInfo(){
List allstudent=adminservice.getallstuInfo();
request=ServletActionContext.getRequest();
request.setAttribute(“allstudent“ allstudent);
return “success“;
}

public String admindeletestu(){
String stuid=ServletActionContext.getRequest().getParameter(“stuid“);
Student deletestudent=new Student();
deletestudent.setStuId(Integer.parseInt(stuid));
if(adminservice.admindeletestu(deletestudent)){
List allstudent=adminservice.getallstuInfo();
request=ServletActionContext.getRequest();
request.setAttribute(“allstudent“ allstudent);
return “success“;
}
else
return “false“;
}

public String admingetSelectedStu(){
String stuid=ServletActionContext.getRequest().getParameter(“stuid“);
int realstuid=Integer.parseInt(stuid);
Student selectedstudent=adminservice.admingetSelectedStu(realstuid);
if(selectedstudent==null)
return “fail“;
else{
request=ServletActionContext.getRequest();
request.setAttribute(“selectedstudent“ selectedstudent);
return “success“;
}
}

public String adminEditStu(){
if(adminservice.adminEditStu(newstudent)){
List allstudent=adminservice.getallstuInfo();
request=ServletActionContext.getRequest();
request.setAttribute(“allstudent“ allstudent);
return “success“;
}
else
return “fail“;
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-12-20 22:39  Manage\
     文件        1586  2012-12-27 23:20  Manage\.classpath
     文件         622  2012-12-27 23:20  Manage\.myhibernatedata
     文件         300  2013-12-23 20:47  Manage\.mymetadata
     文件         240  2012-12-27 23:20  Manage\.mystrutsdata
     文件        2245  2012-12-27 23:20  Manage\.project
     目录           0  2013-12-20 22:39  Manage\.settings\
     文件         493  2012-12-27 23:20  Manage\.settings\.jsdtscope
     目录           0  2013-12-20 22:39  Manage\.settings\.svn\
     文件         974  2013-12-20 22:39  Manage\.settings\.svn\all-wcprops
     文件        1234  2013-12-20 22:39  Manage\.settings\.svn\entries
     文件           2  2012-12-27 23:20  Manage\.settings\.svn\format
     目录           0  2013-12-20 22:39  Manage\.settings\.svn\prop-base\
     文件          39  2013-12-20 22:39  Manage\.settings\.svn\prop-base\org.eclipse.jdt.core.prefs.svn-base
     文件          39  2013-12-20 22:39  Manage\.settings\.svn\prop-base\org.eclipse.wst.common.project.facet.core.xml.svn-base
     目录           0  2013-12-21 23:33  Manage\.settings\.svn\props\
     目录           0  2013-12-20 22:39  Manage\.settings\.svn\text-base\
     文件         493  2013-12-20 22:39  Manage\.settings\.svn\text-base\.jsdtscope.svn-base
     文件         395  2013-12-20 22:39  Manage\.settings\.svn\text-base\org.eclipse.jdt.core.prefs.svn-base
     文件         465  2013-12-20 22:39  Manage\.settings\.svn\text-base\org.eclipse.wst.common.component.svn-base
     文件         252  2013-12-20 22:39  Manage\.settings\.svn\text-base\org.eclipse.wst.common.project.facet.core.xml.svn-base
     文件          49  2013-12-20 22:39  Manage\.settings\.svn\text-base\org.eclipse.wst.jsdt.ui.superType.container.svn-base
     文件           6  2013-12-20 22:39  Manage\.settings\.svn\text-base\org.eclipse.wst.jsdt.ui.superType.name.svn-base
     目录           0  2013-12-20 22:39  Manage\.settings\.svn\tmp\
     目录           0  2013-12-21 23:33  Manage\.settings\.svn\tmp\prop-base\
     目录           0  2013-12-21 23:33  Manage\.settings\.svn\tmp\props\
     目录           0  2013-12-21 23:33  Manage\.settings\.svn\tmp\text-base\
     文件         395  2012-12-27 23:20  Manage\.settings\org.eclipse.jdt.core.prefs
     文件         465  2012-12-27 23:20  Manage\.settings\org.eclipse.wst.common.component
     文件         252  2012-12-27 23:20  Manage\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2012-12-27 23:20  Manage\.settings\org.eclipse.wst.jsdt.ui.superType.container
............此处省略729个文件信息

评论

共有 条评论