• 大小: 394.91 KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2024-10-03
  • 语言: Java
  • 标签:

资源简介

简易教学管理系统(jsp+spring+struts+hibernate+mysql)

资源截图

代码片段和文件信息

package actions;

import java.util.Collection;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.MappingDispatchAction;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathxmlApplicationContext;



import pojo.Admin;

import service.AdminService;

public class AdminAction extends MappingDispatchAction{

ApplicationContext ac = 
new ClassPathxmlApplicationContext(“applicationContext.xml“);
 AdminService aservice =
(AdminService) ac.getBean(“adminServiceImpl“);
 
public ActionForward listadmin(ActionMapping mapping
ActionForm form HttpServletRequest request
HttpServletResponse response) throws Exception {
Collection admins=aservice.findAll();
request.setAttribute(“admins“ admins);


 return mapping.findForward(“success“);

}

public ActionForward addadmin(ActionMapping mapping
ActionForm form HttpServletRequest request
HttpServletResponse response) throws Exception {


 return mapping.findForward(“success“);

}

public ActionForward addadmins(ActionMapping mapping
ActionForm form HttpServletRequest request
HttpServletResponse response) throws Exception {
request.setCharacterEncoding(“gb2312“);
String name=request.getParameter(“name“);
String username=request.getParameter(“username“);
String password=request.getParameter(“password“);
String passwordsec=request.getParameter(“passwordsec“);
String phone=request.getParameter(“phone“);
String email=request.getParameter(“email“);
String info = this.test(name username passwordpasswordsec email
phone);
if (!info.equals(““)) {
request.setAttribute(“type“ info);
return mapping.findForward(“fail“);
}
Admin a=new Admin();
a.setName(name);
a.setUsername(username);
a.setPassword(password);
a.setPhone(phone);
a.setEmail(email);
aservice.addAdmin(a);
Collection admins=aservice.findAll();
request.setAttribute(“admins“ admins);
 return mapping.findForward(“success“);

}

public ActionForward modifyadmin(ActionMapping mapping
ActionForm form HttpServletRequest request
HttpServletResponse response) throws Exception {
request.setCharacterEncoding(“gb2312“);
Collection admins=aservice.findAll();
request.setAttribute(“admins“ admins);
 return mapping.findForward(“success“);

}

public ActionForward modify(ActionMapping mapping
ActionForm form HttpServletRequest request
HttpServletResponse response) throws Exception {
request.setCharacterEncoding(“gb2312“);
String s=request.getQueryString();
String[] ss=s.split(“=“);
int id=Integer.parseInt(ss[1]);
Admin a=aservice.findAdminById(

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

     文件        843  2009-05-15 00:12  student_1\.classpath

     文件        456  2009-05-15 00:12  student_1\.myhibernatedata

     文件        300  2009-05-15 22:50  student_1\.mymetadata

     文件        262  2009-05-15 00:12  student_1\.mystrutsdata

     文件       1720  2009-05-15 00:12  student_1\.project

     文件        320  2009-05-15 00:12  student_1\.springBeans

     文件       5912  2009-05-15 00:12  student_1\WebRoot\a.jsp

     文件       2178  2009-05-16 13:20  student_1\WebRoot\addstudent.jsp

     文件       1635  2009-05-16 13:20  student_1\WebRoot\addteacher.jsp

     文件       5627  2009-05-16 16:36  student_1\WebRoot\admin.jsp

     文件         82  2009-05-15 00:12  student_1\WebRoot\error.jsp

     文件       1535  2009-05-15 00:12  student_1\WebRoot\image.jsp

     文件        834  2009-05-15 00:12  student_1\WebRoot\index.jsp

     文件       3092  2009-05-16 16:46  student_1\WebRoot\login.jsp

     文件        965  2009-05-15 00:12  student_1\WebRoot\marking.jsp

     文件       5441  2009-05-16 16:35  student_1\WebRoot\student.jsp

     文件       5636  2009-05-16 16:36  student_1\WebRoot\teacher.jsp

     文件      29826  2009-05-15 13:13  student_1\WebRoot\WEB-INF\.struts-config.mex

     文件       8860  2009-05-15 00:12  student_1\WebRoot\WEB-INF\struts-bean.tld

     文件      11052  2009-05-15 13:13  student_1\WebRoot\WEB-INF\struts-config.xml

     文件      73617  2009-05-15 00:12  student_1\WebRoot\WEB-INF\struts-html.tld

     文件      14731  2009-05-15 00:12  student_1\WebRoot\WEB-INF\struts-logic.tld

     文件      71483  2009-05-15 00:12  student_1\WebRoot\WEB-INF\struts-nested.tld

     文件       7842  2009-05-15 00:12  student_1\WebRoot\WEB-INF\struts-tiles.tld

     文件      13781  2009-05-15 00:12  student_1\WebRoot\WEB-INF\validator-rules.xml

     文件       1039  2009-05-15 00:12  student_1\WebRoot\WEB-INF\web.xml

     文件       2446  2009-05-15 23:04  student_1\WebRoot\WEB-INF\classes\applicationContext.xml

     文件       2708  2009-05-15 22:50  student_1\WebRoot\WEB-INF\classes\userDAOByHibernateImpl\AdminDAOByHibernateImpl.class

     文件       3960  2009-05-15 22:51  student_1\WebRoot\WEB-INF\classes\userDAOByHibernateImpl\StudentDAOByHibernateImpl.class

     文件       3659  2009-05-15 22:50  student_1\WebRoot\WEB-INF\classes\userDAOByHibernateImpl\TeacherDAOByHibernateImpl.class

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

评论

共有 条评论

相关资源