基于javaweb学生课程管理系统

一、系统简介


本项目采用eclipse工具开发,jsp+servlet+jquery技术编写,数据库采用的是mysql,navicat开发工具。

系统一共分为2个角色分别是:学生,教师

二、模块简介

学生

1、登录注册

2、个人信息管理

3、学生管理

4、课程查看,购买

5、购买记录

教师

1、登录注册

2、个人信息管理

3、教师管理

4、课程管理

5、购买记录

项目简介:

难度等级:✩✩✩
用户类型:2角色(学生,教师)
设计模式:MVC
项目架构:B/S架构
开发语言:Java语言
前端技术:HTML、CSS、JS、JQuery等
后端技术:JSP、servlet框架
运行环境:Windows7或10、JDK1.8
运行工具:本系统采用Eclipse开发,仅支持Eclipse运行,不支持MyEclipse和IDEA运行,因为三者的骨架不一样,强行导入打开运行可能会导致出现未知的错误。(如若想用idea运行,需要转换!!!!)
数  据  库:MySQL5.5/5.7/8.0版本
运行服务器:Tomcat7.0/8.0/8.5/9.0等版本
是否基于Maven环境:否
是否采用框架:是
数据库表数量:4张表
JSP页面数量:15多张
是否有分页:有分页

相关截图

 

 相关代码

<%@ page language="java" pageEncoding="utf-8"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<jsp:include page="/WEB-INF/common/header.jsp"/>
 <script language="javascript">
	 function check1()
	 {                                                                                         
	     if(document.ThisForm.userName.value=="")
		 {
		 	alert("请输入用户名");
			document.ThisForm.userName.focus();
			return false;
		 }
		 if(document.ThisForm.password.value=="")
		 {
		 	alert("请输入密码");
			document.ThisForm.password.focus();
			return false;
		 }
		 if(document.ThisForm.type.value=="-1")
		 {
		 	alert("请选择登录身份");
			document.ThisForm.type.focus();
			return false;
		 }
		 document.form1.submit();
	 }

	
 
     function reg()
     {//参考https://blog.csdn.net/seamon_love/article/details/81698870
		  var strUrl = "<%=path %>/LoginServlet?action=toRegiste";//
          var ret = window.open(strUrl,"","height=400, width=800, top=200, left=400, toolbar=no, menubar=yes, scrollbars=no, resizable=no, location=no, status=no");
	 }
     function reg2()
     {//参考https://blog.csdn.net/seamon_love/article/details/81698870
		  var strUrl = "<%=path %>/StudentServlet?action=toRegiste2";//
          var ret = window.open(strUrl,"","height=400, width=800, top=200, left=400, toolbar=no, menubar=yes, scrollbars=no, resizable=no, location=no, status=no");
	 }
 </script>
</head>
<body>

 
<body>
	<br>
	<br>
	<br>
	<br>
	<table width="559" height="423" border="0" align="center" cellpadding="0" cellspacing="0"  background="<%=path %>/img/">
	 <tr>
	    <td><div align="center" style="FONT-WEIGHT: bold; FONT-SIZE: 25pt;">学生课程管理系统</div></td>
	 </tr>
	 <tr>
		<td width="559">
			<form name="ThisForm" method="post" action="LoginServlet?action=login">
				<table width="410" height="198" border="0" align="right" cellpadding="0" cellspacing="0">
					<tr>
						<td height="5" colspan="2"></td>
					</tr>
			        <tr>
					  
						<td width="356" valign="bottom">
					        用户名:<input name="userName"  type="text" class="input2" onMouseOver="this.style.background='#F0DAF3';" onMouseOut="this.style.background='#FFFFFF'">
						</td>
						<span style="color:red">${msg}</span>
					</tr>
					<tr>
						<td height="10" colspan="2" valign="bottom"></td>
					</tr>
					<tr>
						<td height="31" colspan="2" valign="top" class="STYLE15">
						     密&nbsp;&nbsp;码:
							<input name="password" type="password" size="21" class="input2" align="bottom" onMouseOver="this.style.background='#F0DAF3';" onMouseOut="this.style.background='#FFFFFF'">
						</td>
					</tr>
					<tr>
						<td height="10" colspan="2" valign="bottom"></td>
					</tr>
					<tr style="display: block">
					    <td height="31" colspan="2" valign="top" class="STYLE15">
					         身&nbsp;&nbsp;&nbsp;&nbsp;份:
					         <select class="INPUT_text" name="type">
							    <option value="" selected="selected">请选择登录身份</option>
								<option value="2">学生</option>
								<option value="3">教师</option>
							 </select>
                        </td>
				    </tr>
					<tr>
						<td colspan="2" valign="top">&nbsp; &nbsp; &nbsp; &nbsp;
							<input name="button" type="submit" class="submit1" value="登录" > &nbsp;
<input name="button" type="button" class="submit1" value="学生注册" onclick="reg()">
							<input name="button" type="button" class="submit1" value="教师注册" onclick="reg2()">
														<img id="indicator" src="<%=path %>/img/loading.gif" style="display:none"/>
						</td>
				    </tr>
                </table>
	        </form>
        </td>
     </tr>
    </table>
</body>
protected void login(HttpServletRequest request, HttpServletResponse response) throws Exception {//跳转到添加用户界�?
	    String userName = request.getParameter("userName");
        String password = request.getParameter("password");
        String type = request.getParameter("type");
	  if(type != null && type.equals("2")){//学生 
	    	Student student = ls.selectStudent(userName,password);
	    	 if (student == null) {
				  request.setAttribute("msg","账号或者密码错误"); //绑定参数
				  request.getRequestDispatcher("/WEB-INF/views/login.jsp").forward(request,response);
           } else {
          	    request.getSession().setAttribute("type",2);
               request.getSession().setAttribute("student",student);
               request.getRequestDispatcher("/WEB-INF/views/main.jsp").forward(request,response);
           }
	    }else if(type != null && type.equals("3")){//教师
	    	Teacher teacher = ls.selectTeacher(userName,password);
	    	 if (teacher == null) {
				  request.setAttribute("msg","账号或者密码错误"); //绑定参数
				  request.getRequestDispatcher("/WEB-INF/views/login.jsp").forward(request,response);
            } else {
         	    request.getSession().setAttribute("type",3);
              request.getSession().setAttribute("teacher",teacher);
              request.getRequestDispatcher("/WEB-INF/views/main.jsp").forward(request,response);
          }
	    }else{
	    	 request.setAttribute("msg","请选择角色"); 
			  request.getRequestDispatcher("/WEB-INF/views/login.jsp").forward(request,response);
	    }
	}

其他相关代码都是类似的,主要是前端jsp和后端servlet交互比较重要!!!非开源!!!!!!
其他模块代码都是类似的,此项目适合初学者学习借鉴,项目整体比较简单
喜欢的朋友的点赞加关注,感兴趣的同学可以研究!!!!!
感谢  = v =

项目截图中的数据,很多是用来测试的,需要自行添加合适的数据图片!!

  • 1
    点赞
  • 31
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

码盗_java_bishe

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值