为了复习之前学习的相关的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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<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知识点复习,重新编写学生选课系统的先关操作。的更多相关文章

  1. JAVA | 学生选课系统

    这里使用JAVA语言编写的简易的学生选课系统,展现的都是这个系统核心代码. 其中有不足欢迎批评和指正! 链接数据库的代码 package connection;//连接数据库student impor ...

  2. java web知识点

    java web知识点 1.Java知识点 基本数据类型,面向对象,异常,IO,NIO,集合,多线程,JVM,高级特性. 2.web知识点 JSP,Serlvet,JDBC,Http 掌握Cookie ...

  3. 学生选课系统v1.0

    最近两天写了下老师课上留的作业:学生选课系统.感觉自己写的特别麻烦,思路特别不清晰,平常自己总会偷懒,一些太麻烦细节的功能就不去实现了,用简单的功能来替代,直到自己这回写完这个系统(但自己写的比较lo ...

  4. 学生选课系统 c语言

    /********************************* *主题:学生选修课程系统设计 * *设计要求: *1.添加功能:程序能够任意添加课程和学生记录,可提供选择界面供用户选择所需要添加 ...

  5. python开发项目:学生选课系统

    程序要求:1.创建北京.上海两所学校(分析:通过学校类实例化两个学校实例) 2.创建Linux.python.go三个课程,Linux\go在北京开,Linux在上海开(创建Linux.python. ...

  6. python基础-10 程序目录结构 学生选课系统面向对象练习

    一 程序目录结构 1 bin文件夹 二进制文件.代码程序  2 conf 配置文件  3 帮助文档  4 头文件库文件等 二 学生选课系统部分代码 未完待续 1 包内的__init__.py文件 在包 ...

  7. 学生选课系统(Java语言期末前测试)

      测试具体要求: 2.系统要求与功能设计 2.1 页面要求 (1)能够在Tomcat服务器中正确部署,并通过浏览器查看: (2)网站页面整体风格统一: (3)首页(登录页)要求实现不同用户登录后,进 ...

  8. 期末Java Web大作业----简易的学生管理系统

    学生信息管理系统(大作业) 2018-12-21:此文章已在我的网站更新,添加视图介绍等信息,源码请移步下载https://www.jeson.xin/javaweb-sims.html PS:首先不 ...

  9. 简单的学生选课系统——基于Servlet+Ajax

    以前挖的坑,早晚要往里掉.基础太薄弱,要恶补.在此程序前,我还对Servlet没有一个清晰的概念:一周时间写好此程序之后,对Servlet的理解清晰许多. 这周一直在恶补Spring,今天正好完成了S ...

随机推荐

  1. elementui 在原生方法参数里,添加参数

    公司有个项目需求需要在一个列表中分别上传图片,饿了么的方法不支持传递index,可以这样传递: :on-change="(file,fileList)=>{return changeF ...

  2. 【猫狗数据集】使用预训练的resnet18模型

    数据集下载地址: 链接:https://pan.baidu.com/s/1l1AnBgkAAEhh0vI5_loWKw提取码:2xq4 创建数据集:https://www.cnblogs.com/xi ...

  3. 系统之眼!Linux系统性能监控工具Glances

    一.Glances介绍 glances是一个基于python语言开发,可以为linux或者UNIX性能提供监视和分析性能数据的功能.glances在用户的终端上显示重要的系统信息,并动态的进行更新,让 ...

  4. echarts legend文字配置多个颜色(转)

    困扰很久的问题终于解决了 oh yea! echarts legend文字配置多个颜色legend: {data: [{name:‘直接访问’,icon : ‘circle’,textStyle: { ...

  5. 如何使用域名访问自己的Windows服务器(Java web 项目)

    如何使用域名访问自己的Windows服务器(Java web 项目) 写在前面 前段时间在阿里云弄了个学生服务器,就想着自己搭建一个网站试一试,在网上查阅相关资料时发现大部分都是基于服务器是Linux ...

  6. Fluent算例精选|03利用VOF和蒸发-冷凝模型

    通过学习本算例您将获得? 1.学会基本的VOF模型设置流程 2.学会利用蒸发-冷凝模型来模拟传热沸腾 目录 1摘要4 2传热沸腾模型介绍4 3前处理4 4求解设置5 4.1启动Fluent5 4.2网 ...

  7. MyBatis框架——逆向工程

    什么是逆向工程? 逆向工程师MyBatis提供的一种自动化配置方案,针对数据表自动生成MyBatis所需的各种资源,包括实体类.Mapper接口.Mapper.xml,但是逆向工程的缺陷在于只能针对单 ...

  8. ThinkPHP的几种路由形式总结

    本篇文章总结了ThinkPHP的几种路由形式,分别是普通模式.PATHINFO.REWRITE和兼容模式,希望对各位学习thinkphp的朋友有帮助! thinkphp官方文档里有详细的说明: Thi ...

  9. PhpStorm+XAMPP+Xdebug 集成开发和断点调试环境配置

    0x01 Xdebug安装 参考:https://xdebug.org/docs/install cd xdebug-/ phpize sudo ./configure --enable-xdebug ...

  10. [单调栈]小A的柱状图

    链接:https://ac.nowcoder.com/acm/problem/23619来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 262144K,其他语言52428 ...