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 ...
随机推荐
- jQuery万能放大镜插件(普通矩形放大镜)
插件链接:http://files.cnblogs.com/files/whosMeya/magnifier.js 1.在jquery下插入. 2.格式:magnifier("需要插入的位置 ...
- javaScript 基础知识汇总 (十四)
1.回调 什么是回调? 个人理解,让函数有序的执行. 示例: function loadScript(src,callback){ let script = document.createElemen ...
- Mass Spectrometry-Compatible Subcellular Fractionation for Proteomics 质谱兼容的蛋白质组学的亚细胞分离(解读人:王茹凯)
文献名:Mass Spectrometry-Compatible Subcellular Fractionation for Proteomics(质谱兼容的蛋白质组学的亚细胞分离) 期刊名:Jpor ...
- (翻译) 使用Unity进行AOP对象拦截
Unity 是一款知名的依赖注入容器( dependency injection container) ,其支持通过自定义扩展来扩充功能. 在Unity软件包内 默认包含了一个对象拦截(Interce ...
- 初步了解HTTP协议
1.HTTP简介 全称:Hyper Text Transfer Protocol,中文名:超文本传输协议. 功能:HTTP是客户端浏览器或其他程序与web服务器之间的应用层通信协议. 特点:a.支持 ...
- django自动生成接口文档
我们在实际项目中,会需要将我们的一些接口的信息返回给前端,便于前后端的交互,在实际使用中,这种自动生成接口文档的模块很多,我主要是用REST framework自动生成接口文档,这个需要用到的是cor ...
- 最简易 Pair of Topics解决方法
这个题花费了我两天的时间来解决,最终找到了两个比较简单的方法 首先这个题不难看出是寻找a[i]+a[j]<0的情况,我第一开始直接用两个for循环遍历通过不了,应该是复杂度太大了 第一个方法 # ...
- Webpack抽离第三方类库以及common解决方案
前端构建场景有两种,一种是单页面构建,另一种是多入口构建多页面应用程序(我视野比较小,目前就知道这两种),下面我们针对这两种场景总结了几种抽离第三方类库以及公共文件的解决方案. 如果有哪些地方优化不周 ...
- 你需要了解的 HTTP Status Code
你需要了解的 HTTP Status Code Intro 现在前后端分离的开发模式越来越流行,后端负责开发对应的 API,前端只需要 关注前端页面的数据展示和前端逻辑即可. 对于前后端分离这种开发模 ...
- 学习mybatis框架时配置xml文件解决select莫名其妙报错问题
遇到这种情况,如果语法没有错误,那就可能是你的eclipse在耍你!!! 怎么弄呢,重新建立一个文件,把原来的代码复制到新的文件中就ok啦!不用谢我,我叫雷锋