——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明










基于javaweb的SSH教务学生信息选课成绩管理系统(java+ssh+mysql+jsp)
管理员:
admin 123456
教师:
T001 123456
T002 123456
学生:
S001 123456
S002 123456
S003 123456
管理员管理课程、选课、查看成绩、公告管理、学生管理、老师管理、班级管理等
学生查看课程、选课、向老师留言提问等
老师回复学生留言、创建课程、批改成绩等
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| List<Leaveword> listleaveword = DALBase.getPageEnity("leaveword", filter, pageindex, pagesize); int recordscount = DALBase.getRecordCount("leaveword", filter == null ? "" : filter); request.setAttribute("listleaveword", listleaveword); PagerMetal pm = new PagerMetal(recordscount); pm.setPagesize(pagesize); pm.setCurpageindex(pageindex); request.setAttribute("pagermetal", pm); dispatchParams(request, response); String forwardurl = request.getParameter("forwardurl"); System.out.println("forwardurl=" + forwardurl); if (forwardurl == null) { forwardurl = "/admin/leavewordmanager.jsp"; } forward(forwardurl); } }
public class MajorAction extends PageActionBase {
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| public class KechengAction extends PageActionBase {
private void waitXuanke() { String filter = "where status='选课中' "; String subname = request.getParameter("subname"); if (subname != null) filter += " and subname like '%" + subname + "%' "; int pageindex = 1; int pagesize = 10; String currentpageindex = request.getParameter("currentpageindex"); String currentpagesize = request.getParameter("pagesize"); if (currentpageindex != null) pageindex = new Integer(currentpageindex); if (currentpagesize != null) pagesize = new Integer(currentpagesize); List<Kecheng> listkecheng = DALBase.getPageEnity("kecheng", filter, pageindex, pagesize); int recordscount = DALBase.getRecordCount("kecheng", filter == null ? "" : filter); request.setAttribute("listkecheng", listkecheng); PagerMetal pm = new PagerMetal(recordscount); pm.setPagesize(pagesize); pm.setCurpageindex(pageindex); request.setAttribute("pagermetal", pm); dispatchParams(request, response); String forwardurl = request.getParameter("forwardurl"); System.out.println("forwardurl=" + forwardurl); if (forwardurl == null) { forwardurl = "/admin/kechengmanager.jsp"; } forward(forwardurl); }
private void endXuanke() { String forwardurl = request.getParameter("forwardurl"); String id = request.getParameter("id"); if (id == null) return;
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| public class UploadAction extends ActionSupport { private static final long serialVersionUID = 1L; private static final String CONTENT_TYPE= "text/html; charset=utf-8"; public String execute() { HttpServletResponse response = (HttpServletResponse)ActionContext.getContext().get(org.apache.struts2.StrutsStatics.HTTP_RESPONSE); HttpServletRequest request = (HttpServletRequest)ActionContext.getContext().get(org.apache.struts2.StrutsStatics.HTTP_REQUEST); SingleFileUpload upload = new SingleFileUpload(); System.out.println("folder="+request.getParameter("folder")); try { upload.parseRequest(request); } catch (UnsupportedEncodingException e1) { e1.printStackTrace(); } String temp =ServletActionContext.getServletContext().getRealPath("/") + "upload\\temp\\"; System.out.print("上传路径:"+temp); String loadpath = ServletActionContext.getServletContext().getRealPath("/") + "upload\\"; File file = new File(temp); if(!file.exists()) file.mkdirs(); try { upload.upload(file); response.getWriter().write(upload.getFileItem().getName()); } catch(org.apache.commons.fileupload.FileUploadBase.SizeLimitExceededException e){ e.printStackTrace(); }catch (Exception e){ e.printStackTrace(); } return null; }
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| SQL+=" and xk.stno='"+stno+"'"; if (subname != null) SQL += " and kc.subname like '%" + subname + "%' "; int pageindex = 1; int pagesize = 10; String currentpageindex = request.getParameter("currentpageindex"); String currentpagesize = request.getParameter("pagesize"); if (currentpageindex != null) pageindex = new Integer(currentpageindex); if (currentpagesize != null) pagesize = new Integer(currentpagesize); List<Kecheng> listkecheng = DALBase.runNativeSQLInPage(SQL, Kecheng.class, pageindex, pagesize); int recordscount = DALBase.getNativeSQLCount(SQL); request.setAttribute("listkecheng", listkecheng); PagerMetal pm = new PagerMetal(recordscount); pm.setPagesize(pagesize); pm.setCurpageindex(pageindex); request.setAttribute("pagermetal", pm); dispatchParams(request, response); String forwardurl = request.getParameter("forwardurl"); System.out.println("forwardurl=" + forwardurl); if (forwardurl == null) { forwardurl = "/admin/kechengmanager.jsp"; } forward(forwardurl); }
public void binding() { String filter = "where 1=1 ";
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| public class UploadAction extends ActionSupport { private static final long serialVersionUID = 1L; private static final String CONTENT_TYPE= "text/html; charset=utf-8"; public String execute() { HttpServletResponse response = (HttpServletResponse)ActionContext.getContext().get(org.apache.struts2.StrutsStatics.HTTP_RESPONSE); HttpServletRequest request = (HttpServletRequest)ActionContext.getContext().get(org.apache.struts2.StrutsStatics.HTTP_REQUEST); SingleFileUpload upload = new SingleFileUpload(); System.out.println("folder="+request.getParameter("folder")); try { upload.parseRequest(request); } catch (UnsupportedEncodingException e1) { e1.printStackTrace(); } String temp =ServletActionContext.getServletContext().getRealPath("/") + "upload\\temp\\"; System.out.print("上传路径:"+temp); String loadpath = ServletActionContext.getServletContext().getRealPath("/") + "upload\\"; File file = new File(temp); if(!file.exists()) file.mkdirs(); try { upload.upload(file); response.getWriter().write(upload.getFileItem().getName()); } catch(org.apache.commons.fileupload.FileUploadBase.SizeLimitExceededException e){ e.printStackTrace(); }catch (Exception e){
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=311323462409201gc
https://javayms.pages.dev?id=311323462409201gc