java web知识点复习,重新编写学生选课系统的先关操作。
为了复习之前学习的相关的html,javaweb等知识。自己有重新编写了一遍学生选课系统。
下面主要展示登录界面的代码,以及各个大的主页面的相关jsp。
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
<script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
<title>登录</title>
<style type="text/css">
*{
padding:0px;
margin:0px;
}
.header{
width:%;
height:120px;
background-color:#D2E9FF;
text-align:center;
}
.container{
width:%;
height:552px;
position:relative;
background-color:#A6FFFF;
}
.login{
width:500px;
height:auto;
background-color:white;
position:absolute;
top:50px;
left:320px;
border-radius:8px;
}
label{
float:left;
width:100px;
margin-top:7px;
margin-right:5px;
}
.form-control{
width:%;
}
.logtip{
padding-top:20px;
padding-bottom:20px;
border-bottom:2px solid red;
text-align:center;
}
.form-group{
margin-left:33px;
margin-top:33px;
}
.btn{
height:50px;
width:100px;
float:left;
border-radius:10px;
}
.logbtn{
margin-right:20px;
} .btnbag{
margin-left:140px;
margin-right:140px;
height:50px;
overflow:hidden;
margin-top:30px;
margin-bottom:40px;
}
</style>
</head>
<body>
<div class="header"><h2>学生选课系统</h2></div> <div class="container">
<div class="login"> <h2 class="logtip">登录</h2>
<form action="login_do" method="post">
<div class="form-group"> <label for="username">用户名</label>
<input type="text" class="form-control" id="username" name="username">
</div>
<div class="form-group"> <label for="password">密码</label>
<input type="password" class="form-control" id="password" name="password">
</div>
<div class="form-group">
<label for="name">类型</label>
<select name="leibie" id="leibie" required="required" class="form-control" >
<option value="管理员">管理员</option>
<option value="学生">学生</option>
<option value="老师">老师</option>
</select>
</div>
<div class="btnbag">
<input type="button" class="btn btn-primary logbtn" onclick="login()" value="登录">
<input type="button" class="btn btn-primary mangbtn" onclick="entermang()" value="进入管理">
</div>
</form>
</div>
</div> <div class="footer"></div>
</body>
<script>
function login()
{
var username=$("#username").val();
var password=$("#password").val();
var leibie=$("#leibie").val();
if(username==""||password=="")
alert("请将信息填写完整!");
else
{
$.post(
"registecheck",
{"name":username,
"password":password,
"role":leibie},
function(data){
if(data=="yes")
{
if(leibie=="学生")
{
alert("学生身份验证成功登陆!");
window.location="TheWord1.jsp?value="+username;
}
else if(leibie=="老师")
{
alert("老师身份验证成功登陆!");
window.location="TheWord2.jsp?value="+username;
}
else
{
alert("管理员登录,请点击进入管理按钮");
}
}
else
alert("用户名或密码错误,登录失败!");
},
"text"
);
}
}
function entermang()
{
var username=$("#username").val();
var password=$("#password").val();
var leibie=$("#leibie").val();
if(username==""||password=="")
alert("请将信息填写完整!");
else
{
$.post(
"registecheck",
{"name":username,
"password":password,
"number":leibie},
function(data){
if(data=="yes")
{ if(leibie=="管理员")
{
alert("管理员进入管理成功!");
window.location="TheWord3.jsp?value="+username;
}
}
else
alert("用户名或密码错误!");
},
"text"
);
}
}
</script>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<script> function onload()
{
<%
String value="";
value=request.getParameter("value");
%>
$("#informationshow").text("当前登录账户:<%=value %>");
}
function exitlog(event)
{
var msg = "您确定要注销吗?";
if (confirm(msg)==true){
event.href="index.jsp";
}
else{
alert("操作取消!");
}
}
</script>
</head>
<body onload="onload()">
<div class="header">
<h2>欢迎来到学生选课系统</h2>
<div class="loginfoshow" id="userinfor">
<p id="informationshow"></p>
<a href="" onclick="exitlog(this)">[注销]</a>
</div>
</div>
<div class="contain">
<div class="list-group"> <a id="" href="lookmessage?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">查看个人信息</a>
<a id="" href="updatamessage?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">修改基本信息</a>
<a id="" href="changepassword.jsp?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">修改密码</a> <a id="" href="choiceclass?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">进行选课</a>
<a id="" href="lookclass?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">查看已选课程</a> </div>
<div class="operation">
<iframe name="operation" src="" width="100%" height="100%" style="background-color: gray;"></iframe>
</div>
</div>
<div class="footer"></div>
</body>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<script> function onload()
{
<%
String value="";
value=request.getParameter("value");
%>
$("#informationshow").text("当前登录账户:<%=value %>");
}
function exitlog(event)
{
var msg = "您确定要注销吗?";
if (confirm(msg)==true){
event.href="index.jsp";
}
else{
alert("操作取消!");
}
}
</script>
</head>
<body onload="onload()">
<div class="header">
<h2>欢迎来到老师课程系统</h2>
<div class="loginfoshow" id="userinfor">
<p id="informationshow"></p>
<a href="" onclick="exitlog(this)">[注销]</a>
</div>
</div>
<div class="contain">
<div class="list-group"> <a id="" href="lookmessage?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">查看个人信息</a>
<a id="" href="updatamessage?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">修改基本信息</a>
<a id="" href="changepassword.jsp?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">修改密码</a> <a id="" href="lookclassall?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">查看本人课程</a>
<a id="" href="lookclassseach?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">课程操作</a>
<a id="" href="addclass.jsp?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">增加新的课程</a> </div>
<div class="operation">
<iframe name="operation" src="" width="100%" height="100%" style="background-color: gray;"></iframe>
</div>
</div>
<div class="footer"></div>
</body>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<script> function onload()
{
<%
String value="";
value=request.getParameter("value");
%>
$("#informationshow").text("当前登录账户:<%=value %>");
}
function exitlog(event)
{
var msg = "您确定要注销吗?";
if (confirm(msg)==true){
event.href="index.jsp";
}
else{
alert("操作取消!");
}
}
</script>
</head>
<body onload="onload()">
<div class="header">
<h2>欢迎来到老师课程系统</h2>
<div class="loginfoshow" id="userinfor">
<p id="informationshow"></p>
<a href="" onclick="exitlog(this)">[注销]</a>
</div>
</div>
<div class="contain">
<div class="list-group"> <a id="" href="lookmessage?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">查看个人信息</a>
<a id="" href="updatamessage?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">修改基本信息</a>
<a id="" href="changepassword.jsp?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">修改密码</a> <a id="" href="addnewuser.jsp?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">增加用户</a>
<a id="" href="updatausermessage?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">修改用户信息</a> </div>
<div class="operation">
<iframe name="operation" src="" width="100%" height="100%" style="background-color: gray;"></iframe>
</div>
</div>
<div class="footer"></div>
</body>
</body>
</html>
其中的登录界面的截图如下:
java web知识点复习,重新编写学生选课系统的先关操作。的更多相关文章
- JAVA | 学生选课系统
这里使用JAVA语言编写的简易的学生选课系统,展现的都是这个系统核心代码. 其中有不足欢迎批评和指正! 链接数据库的代码 package connection;//连接数据库student impor ...
- java web知识点
java web知识点 1.Java知识点 基本数据类型,面向对象,异常,IO,NIO,集合,多线程,JVM,高级特性. 2.web知识点 JSP,Serlvet,JDBC,Http 掌握Cookie ...
- 学生选课系统v1.0
最近两天写了下老师课上留的作业:学生选课系统.感觉自己写的特别麻烦,思路特别不清晰,平常自己总会偷懒,一些太麻烦细节的功能就不去实现了,用简单的功能来替代,直到自己这回写完这个系统(但自己写的比较lo ...
- 学生选课系统 c语言
/********************************* *主题:学生选修课程系统设计 * *设计要求: *1.添加功能:程序能够任意添加课程和学生记录,可提供选择界面供用户选择所需要添加 ...
- python开发项目:学生选课系统
程序要求:1.创建北京.上海两所学校(分析:通过学校类实例化两个学校实例) 2.创建Linux.python.go三个课程,Linux\go在北京开,Linux在上海开(创建Linux.python. ...
- python基础-10 程序目录结构 学生选课系统面向对象练习
一 程序目录结构 1 bin文件夹 二进制文件.代码程序 2 conf 配置文件 3 帮助文档 4 头文件库文件等 二 学生选课系统部分代码 未完待续 1 包内的__init__.py文件 在包 ...
- 学生选课系统(Java语言期末前测试)
测试具体要求: 2.系统要求与功能设计 2.1 页面要求 (1)能够在Tomcat服务器中正确部署,并通过浏览器查看: (2)网站页面整体风格统一: (3)首页(登录页)要求实现不同用户登录后,进 ...
- 期末Java Web大作业----简易的学生管理系统
学生信息管理系统(大作业) 2018-12-21:此文章已在我的网站更新,添加视图介绍等信息,源码请移步下载https://www.jeson.xin/javaweb-sims.html PS:首先不 ...
- 简单的学生选课系统——基于Servlet+Ajax
以前挖的坑,早晚要往里掉.基础太薄弱,要恶补.在此程序前,我还对Servlet没有一个清晰的概念:一周时间写好此程序之后,对Servlet的理解清晰许多. 这周一直在恶补Spring,今天正好完成了S ...
随机推荐
- CSRF攻击原理及预防手段
CSRF全程 Cross Site Request Forgery, 跨站域请求伪造.这种攻击方式相对于XSS,SQL注入等攻击方式比较晚被发现,今天就来讲解下这种攻击方式以及避免方式. 攻击过程 ...
- linux ftp服务器设置,只允许用户访问指定的文件夹,禁止访问其他文件夹
在Linux中添加ftp用户,并设置相应的权限,操作步骤如下: 1.环境:ftp为vsftp.被限制用户名为test.被限制路径为/home/test 2.建用户:在root用户下: useradd ...
- js 图片实现无缝滚动
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- node 微信退款
基于node 的微信退款 申请微信退款:微信退款, 1.在前端页面访问 /refund var request = require('request'); var WxPayRefund = req ...
- mysql的那些事之架构
MySQL架构的那些事 此篇博客为原创,欢迎转载,转载时请注明出处,谢谢 最近深入学习了一下mysql的内容,想把自己的理解分享出来. mysql架构 逻辑架构 Connectors:连接器 Mana ...
- 爬虫前奏——代理ip的使用
如果同一个IP短时见内多次访问统一网页,可能会被系统识别出是爬虫,因此使用代理IP可以很大程度上解决这一问题 常用的代理有: 西刺免费代理:www.xicidaili.com 快代理:www.kuai ...
- (转)C++ 虚函数表解析
原文地址:http://blog.csdn.net/haoel/article/details/1948051 C++ 虚函数表解析 陈皓 http://blog.csdn.net/haoel 前言 ...
- GPU Skinning不生效问题
1)GPU Skinning不生效问题2)勾选凸包报的警告问题3)Unity 2019 图片压缩格式选择4)Android Export打包对压缩的影响5)Android内存中的Unknown部分泄漏 ...
- BJDCTF
python3的模板注入 非常简单...就是直接执行命令就行..虽然过滤了flag,但是拼接下就好了.... payload: http://fd5883ee-b8e2-4bf1-88af-33936 ...
- 记一次Maven发布Jar包中文乱码解决方法
Maven deploy 乱码 今天使用Maven发布Jar包时,发布功能都是正常的也成功上传到了仓库,就是项目跑越来后出中文中现了乱码: { "code": "SUCC ...