您好,欢迎来到五一七教育网。
搜索
您的当前位置:首页Javaweb学生信息管理系统(Mysql+JSP+MVC+CSS)

Javaweb学生信息管理系统(Mysql+JSP+MVC+CSS)

来源:五一七教育网


一.项目介绍

本系统主要实现对基于Javaweb学生信息管理系统所需的各项基本功能,能够对学生信息进行增删改查等功能,并可以实现用户注册、用户登陆等功能。

数据库:Mysql

开发工具:Eclipse

开发环境:JDK+Tomcat

二.运行效果

1.登录界面

2.主界面(点击学号修改学生信息)

3.增加学生界面

三.项目目录结构

四.代码展示

1.jsp及css代码

①登录界面代码(login.jsp)

<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<link href="css/login.css" type="text/css" rel="stylesheet">
<meta charset="UTF-8">

<title>学生信息管理系统-登录界面</title>
</head>
<body>
	<form action="CheckLoginServlet" method="post">
		<div class="content">
			<div class="wrap">
				<div class="login-box">
					<div class="login-frame">
						<h2>
							用户登录 <a href="register.jsp"> 立即注册</a>
						</h2>
						<div class=item>
							<input type="text" name="UID" placeholder="用户名">
						</div>
						<div class=item>
							<input type="password" name="upwd" placeholder="密码">
						</div>
						<input type="submit" class="login-btn" value="登 录">
						<div class=item1>
							<a href="UpdateLoginPwd.jsp"> 修改密码</a> 
							<a	href="DeleteLoginID.jsp"> 注销用户</a>
						</div>
						<%
							String error = (String) request.getAttribute("error");
							String error0 = (String) request.getAttribute("error0");
							String error1 = (String) request.getAttribute("error1");
							String error2 = (String) request.getAttribute("error2");
							String error3 = (String) request.getAttribute("error3");
							String error4 = (String) request.getAttribute("error4");

							if (error != null) {
								if (error.equals("loginError")) {
									out.println("用户名或密码错误!登录失败!");
								} else if (error.equals("nologinError")) {
									response.sendRedirect("QueryStudentByPageServlet");
								}
							}

							if (error0 != null) {
								if (error0.equals("loginError")) {
									out.println("用户名或密码错误!修改失败!");
								} else if (error0.equals("nologinError")) {
									if (error1 != null) {
								if (error1.equals("noupdateError")) {
									out.println("密码修改成功!");
								}
									}
								}
							}
							if (error2 != null) {
								if (error2.equals("loginError")) {
									out.println("用户名或密码错误!注销失败!");
								} else if (error2.equals("nologinError")) {
									if (error3 != null) {
								if (error3.equals("nodeleteError")) {
									out.println("账户注销成功!");
								}
									}
								}
							}
							if (error4 != null) {
								if (error4.equals("noaddError")) {
									out.println("账户注册成功!");
								}
							}
							%>
						</div>
					</div>
				</div>
			</div>
	</form>

</body>



</html>

②登录界面css(login.css)

*{margin:0;padding:0;}
a{text-decoration:none;color:#666;}
a:hover{
	text-decoration:underline;
	color:E4393C;
}
html,body
{
	font:12px/150% Arial,Verdana;
}

.wrap{
	width:1000px;
	margin:0 auto;
}
.left{
	float:left;
}

.content{
	background:url(../image/login.jpg);
	background-size: cover;
	width:1280px;
	height:559px;
}

.login-frame{
	margin:50px 5% 50px 5%;
	float:right;
	padding:60px;
	background:white;
	background-color:rgba(255,255,255,0.9);
	border-radius:25px;
	order-right:1px #bdbdbd solid;
	width:280px;
	height:230px;
}


.login-frame h2{
	font-size:25px;
	height:40px;
	margin-buttom:25px;
}
.login-frame h2 a{
	font-size:15px;
	color:#59c2c5;
	padding-left:20px;
	background:url(../image/icon5.jpg)no-repeat;
}

.login-frame .item{
	height:60px;
	margin-buttom:40px;
}

.login-frame .item input{
	line-height:40px;
	width:260px;
	border:none;
	border-bottom: 1px solid #59c2c5;
}

.login-btn{
	display:block;
	height:50px;display:block;
	height:50px;
	color:#fff;
	background:#59c2c5;
	width:265px;
	font-size:16px;
	line-height:30px;
	text-align:center;
	border-radius:10px;
	border:none;
	color:#fff;
	background:#59c2c5;
	width:265px;
	font-size:16px;
	line-height:30px;
	text-align:center;
	border-radius:10px;
	border:none;
}
.login-frame .item1{
	dislpay:flex;
	justify-content: space-between;
	margin-top:1 rem;
}
.login-frame .item1 a{
	line-height:40px;
	font-size:1.1rem;
	margin-top:5 rem;
	padding:1rem 3rem;
}

③注册用户界面(register.jsp)

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<link href="css/index.css" type="text/css" rel="stylesheet">
<meta charset="UTF-8">
<script type = "text/javascript" src = "js/jquery-3.6.0.js"></script>
	
	<script type = "text/javascript">
	function check()
	{
		var UID = $("#UID").val();
		var upwd = $("#upwd").val();
		var upwd1 = $("#upwd1").val();
		if(upwd != upwd1){
			alert("两次输入的密码不一致,请重新输入!");
			return false;
		}
		
		return true;
	}
	 $(document).ready(function(){
	 });
	</script>
<title>注册账号</title>
</head>
<body>
	<form action = "AddLoginIDServlet" method = "post" onsubmit = "return check()">
	<div class = "content">
		<div class = "box">
		<div class = "item1">
		<h2>用户注册</h2>
		</div>
		<div class = "item">
		<input type = "text" name = "UID" id = "UID" placeholder="账号"/><br/>
		</div>
		<div class = "item">
		<input type = "password" name = "upwd" id = "upwd" placeholder="密码"/><br/>
		</div>
		<div class = "item">
		<input type = "password" name = "upwd1" id = "upwd1" placeholder="确认密码"/><br/>
		</div>
		<input type = "submit" class = "btn" value = "注册"/><br/>
		<a href = "login.jsp">返回</a>
		<%
		String error4 = (String) request.getAttribute("error4");
		if (error4!= null) {
		if (error4.equals("addError")) {
			out.println("注册失败!账户名已经存在!");
		} 
	}
	%>
	</div>
	</div>
	</form>
	
</body>
</html>

④注册用户界面css(index.css)

*{margin:0;padding:0;}
html,body
{
	font:12px/150% Arial,Verdana;
}
.content{
	background:url(../image/login.jpg);
	background-size: cover;
	width:1280px;
	height:559px;
}
.box{
	margin:60px 18% 60px 18%;
	float:right;
	padding:30px;
	background:white;
	background-color:rgba(255,255,255,0.9);
	border-radius:15px;
	
}
.item{
	height:60px;
	margin-buttom:40px;
}
.item input{
	line-heigh

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- 517ttc.cn 版权所有 赣ICP备2024042791号-8

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务