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 ...
随机推荐
- 在ES批量插入数据超时时自动重试
当我们使用ES批量插入数据的时候,一般会这样写代码: from elasticsearch import Elasticsearch,helpers es =Elasticsearch(hosts=[ ...
- 代码备份 | 博客侧边栏公告(支持HTML代码)(支持JS代码)
博客侧边栏公告(支持HTML代码)(支持JS代码) <div id='btnList'> <a class="ivu-btn ivu-btn-primary" h ...
- Python 之 copy() 与 deepcopy() 之间的区别
在 Python 之中,如果想要复制一个对象就免不了要理解浅复制与深复制.这也是 Python 与其他语言的区别之一. Python 的数据存储方式与其他语言不同.当你定义了一个变量: a = [, ...
- 英伟达GPU虚拟化---申请英伟达测试License
此文基于全新的License 2.0系统,针对vGPU License的试用申请以及软件下载和License管理进行了详细的说明,方便今后我们申请测试License,快速验证GPU的功能. 试用步骤: ...
- Git 的简单使用及ssh配置问题-赖大大
软件安装 第一步当然是安装啦. 官方网址:https://git-scm.com/ 具体操作 在你本地电脑的文件夹里右击鼠标,选Git base here 显然,你是在本地仓库的master分支上,通 ...
- 【ES】Java High Level REST Client 使用示例(增加修改)
ES提供了多种编程语言的链接方式,有Java API,PHP API,.NET API 官网可以详细了解 https://www.elastic.co/guide/en/elasticsearch/c ...
- 2020年Java基础高频面试题汇总(1.4W字详细解析)
1. Java语言有哪些特点 (1)简单易学.有丰富的类库 (2)面向对象(Java最重要的特性,让程序耦合度更低,内聚性更高) (3)与平台无关性(JVM是Java跨平台使用的根本) (4)可靠安全 ...
- Python编写“求一元二次方程的解”
#求一元二次方程的解 import math def equation(a,b,c): h=b*b-4*a*c #一元二次方程的解,百度来的 if h>=0: x1=(-b+math.sqrt( ...
- loadrunner-事务
自从安装了loadrunner之后,就没怎么用过它了,项目之前也没做过性能测试,所以学习起来比较困难,而且性能测试远远不止使用工具这么简单.下面介绍一下最近学习的loadrunner添加事务. 事务是 ...
- 第十七周Java实验作业
实验十七 线程同步控制 实验时间 2018-12-10 1.实验目的与要求 (1) 掌握线程同步的概念及实现技术: 多线程并发运行不确定性问题解决方案:引入线程同步机制,使得另一线程使用该方法,就只 ...