为了复习之前学习的相关的html,javaweb等知识。自己有重新编写了一遍学生选课系统。

下面主要展示登录界面的代码,以及各个大的主页面的相关jsp。

  1. <%@ page language="java" contentType="text/html; charset=utf-8"
  2. pageEncoding="utf-8"%>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
  8. <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
  9. <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
  10. <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
  11. <title>登录</title>
  12. <style type="text/css">
  13. *{
  14. padding:0px;
  15. margin:0px;
  16. }
  17. .header{
  18. width:%;
  19. height:120px;
  20. background-color:#D2E9FF;
  21. text-align:center;
  22. }
  23. .container{
  24. width:%;
  25. height:552px;
  26. position:relative;
  27. background-color:#A6FFFF;
  28. }
  29. .login{
  30. width:500px;
  31. height:auto;
  32. background-color:white;
  33. position:absolute;
  34. top:50px;
  35. left:320px;
  36. border-radius:8px;
  37. }
  38. label{
  39. float:left;
  40. width:100px;
  41. margin-top:7px;
  42. margin-right:5px;
  43. }
  44. .form-control{
  45. width:%;
  46. }
  47. .logtip{
  48. padding-top:20px;
  49. padding-bottom:20px;
  50. border-bottom:2px solid red;
  51. text-align:center;
  52. }
  53. .form-group{
  54. margin-left:33px;
  55. margin-top:33px;
  56. }
  57. .btn{
  58. height:50px;
  59. width:100px;
  60. float:left;
  61. border-radius:10px;
  62. }
  63. .logbtn{
  64. margin-right:20px;
  65. }
  66.  
  67. .btnbag{
  68. margin-left:140px;
  69. margin-right:140px;
  70. height:50px;
  71. overflow:hidden;
  72. margin-top:30px;
  73. margin-bottom:40px;
  74. }
  75. </style>
  76. </head>
  77. <body>
  78. <div class="header"><h2>学生选课系统</h2></div>
  79.  
  80. <div class="container">
  81. <div class="login">
  82.  
  83. <h2 class="logtip">登录</h2>
  84. <form action="login_do" method="post">
  85. <div class="form-group">
  86.  
  87. <label for="username">用户名</label>
  88. <input type="text" class="form-control" id="username" name="username">
  89. </div>
  90. <div class="form-group">
  91.  
  92. <label for="password">密码</label>
  93. <input type="password" class="form-control" id="password" name="password">
  94. </div>
  95. <div class="form-group">
  96. <label for="name">类型</label>
  97. <select name="leibie" id="leibie" required="required" class="form-control" >
  98. <option value="管理员">管理员</option>
  99. <option value="学生">学生</option>
  100. <option value="老师">老师</option>
  101. </select>
  102. </div>
  103. <div class="btnbag">
  104. <input type="button" class="btn btn-primary logbtn" onclick="login()" value="登录">
  105. <input type="button" class="btn btn-primary mangbtn" onclick="entermang()" value="进入管理">
  106. </div>
  107. </form>
  108. </div>
  109. </div>
  110.  
  111. <div class="footer"></div>
  112. </body>
  113. <script>
  114. function login()
  115. {
  116. var username=$("#username").val();
  117. var password=$("#password").val();
  118. var leibie=$("#leibie").val();
  119. if(username==""||password=="")
  120. alert("请将信息填写完整!");
  121. else
  122. {
  123. $.post(
  124. "registecheck",
  125. {"name":username,
  126. "password":password,
  127. "role":leibie},
  128. function(data){
  129. if(data=="yes")
  130. {
  131. if(leibie=="学生")
  132. {
  133. alert("学生身份验证成功登陆!");
  134. window.location="TheWord1.jsp?value="+username;
  135. }
  136. else if(leibie=="老师")
  137. {
  138. alert("老师身份验证成功登陆!");
  139. window.location="TheWord2.jsp?value="+username;
  140. }
  141. else
  142. {
  143. alert("管理员登录,请点击进入管理按钮");
  144. }
  145. }
  146. else
  147. alert("用户名或密码错误,登录失败!");
  148. },
  149. "text"
  150. );
  151. }
  152. }
  153. function entermang()
  154. {
  155. var username=$("#username").val();
  156. var password=$("#password").val();
  157. var leibie=$("#leibie").val();
  158. if(username==""||password=="")
  159. alert("请将信息填写完整!");
  160. else
  161. {
  162. $.post(
  163. "registecheck",
  164. {"name":username,
  165. "password":password,
  166. "number":leibie},
  167. function(data){
  168. if(data=="yes")
  169. {
  170.  
  171. if(leibie=="管理员")
  172. {
  173. alert("管理员进入管理成功!");
  174. window.location="TheWord3.jsp?value="+username;
  175. }
  176. }
  177. else
  178. alert("用户名或密码错误!");
  179. },
  180. "text"
  181. );
  182. }
  183. }
  184. </script>
  185. </html>
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <meta charset="UTF-8">
  7. <title>Insert title here</title>
  8. </head>
  9. <body>
  10. <script>
  11.  
  12. function onload()
  13. {
  14. <%
  15. String value="";
  16. value=request.getParameter("value");
  17. %>
  18. $("#informationshow").text("当前登录账户:<%=value %>");
  19. }
  20. function exitlog(event)
  21. {
  22. var msg = "您确定要注销吗?";
  23. if (confirm(msg)==true){
  24. event.href="index.jsp";
  25. }
  26. else{
  27. alert("操作取消!");
  28. }
  29. }
  30. </script>
  31. </head>
  32. <body onload="onload()">
  33. <div class="header">
  34. <h2>欢迎来到学生选课系统</h2>
  35. <div class="loginfoshow" id="userinfor">
  36. <p id="informationshow"></p>
  37. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  38. <a href="" onclick="exitlog(this)">[注销]</a>
  39. </div>
  40. </div>
  41. <div class="contain">
  42. <div class="list-group">
  43.  
  44. <a id="" href="lookmessage?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">查看个人信息</a>
  45. <a id="" href="updatamessage?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">修改基本信息</a>
  46. <a id="" href="changepassword.jsp?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">修改密码</a>
  47.  
  48. <a id="" href="choiceclass?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">进行选课</a>
  49. <a id="" href="lookclass?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">查看已选课程</a>
  50.  
  51. </div>
  52. <div class="operation">
  53. <iframe name="operation" src="" width="100%" height="100%" style="background-color: gray;"></iframe>
  54. </div>
  55. </div>
  56. <div class="footer"></div>
  57. </body>
  58. </body>
  59. </html>
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <meta charset="UTF-8">
  7. <title>Insert title here</title>
  8. </head>
  9. <body>
  10. <script>
  11.  
  12. function onload()
  13. {
  14. <%
  15. String value="";
  16. value=request.getParameter("value");
  17. %>
  18. $("#informationshow").text("当前登录账户:<%=value %>");
  19. }
  20. function exitlog(event)
  21. {
  22. var msg = "您确定要注销吗?";
  23. if (confirm(msg)==true){
  24. event.href="index.jsp";
  25. }
  26. else{
  27. alert("操作取消!");
  28. }
  29. }
  30. </script>
  31. </head>
  32. <body onload="onload()">
  33. <div class="header">
  34. <h2>欢迎来到老师课程系统</h2>
  35. <div class="loginfoshow" id="userinfor">
  36. <p id="informationshow"></p>
  37. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  38. <a href="" onclick="exitlog(this)">[注销]</a>
  39. </div>
  40. </div>
  41. <div class="contain">
  42. <div class="list-group">
  43.  
  44. <a id="" href="lookmessage?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">查看个人信息</a>
  45. <a id="" href="updatamessage?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">修改基本信息</a>
  46. <a id="" href="changepassword.jsp?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">修改密码</a>
  47.  
  48. <a id="" href="lookclassall?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">查看本人课程</a>
  49. <a id="" href="lookclassseach?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">课程操作</a>
  50. <a id="" href="addclass.jsp?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">增加新的课程</a>
  51.  
  52. </div>
  53. <div class="operation">
  54. <iframe name="operation" src="" width="100%" height="100%" style="background-color: gray;"></iframe>
  55. </div>
  56. </div>
  57. <div class="footer"></div>
  58. </body>
  59. </body>
  60. </html>
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <meta charset="UTF-8">
  7. <title>Insert title here</title>
  8. </head>
  9. <body>
  10. <script>
  11.  
  12. function onload()
  13. {
  14. <%
  15. String value="";
  16. value=request.getParameter("value");
  17. %>
  18. $("#informationshow").text("当前登录账户:<%=value %>");
  19. }
  20. function exitlog(event)
  21. {
  22. var msg = "您确定要注销吗?";
  23. if (confirm(msg)==true){
  24. event.href="index.jsp";
  25. }
  26. else{
  27. alert("操作取消!");
  28. }
  29. }
  30. </script>
  31. </head>
  32. <body onload="onload()">
  33. <div class="header">
  34. <h2>欢迎来到老师课程系统</h2>
  35. <div class="loginfoshow" id="userinfor">
  36. <p id="informationshow"></p>
  37. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  38. <a href="" onclick="exitlog(this)">[注销]</a>
  39. </div>
  40. </div>
  41. <div class="contain">
  42. <div class="list-group">
  43.  
  44. <a id="" href="lookmessage?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">查看个人信息</a>
  45. <a id="" href="updatamessage?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">修改基本信息</a>
  46. <a id="" href="changepassword.jsp?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">修改密码</a>
  47.  
  48. <a id="" href="addnewuser.jsp?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">增加用户</a>
  49. <a id="" href="updatausermessage?name=<%=value %>" class="list-group-item list-group-item-aciton" target="operation">修改用户信息</a>
  50.  
  51. </div>
  52. <div class="operation">
  53. <iframe name="operation" src="" width="100%" height="100%" style="background-color: gray;"></iframe>
  54. </div>
  55. </div>
  56. <div class="footer"></div>
  57. </body>
  58. </body>
  59. </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. 在ES批量插入数据超时时自动重试

    当我们使用ES批量插入数据的时候,一般会这样写代码: from elasticsearch import Elasticsearch,helpers es =Elasticsearch(hosts=[ ...

  2. 代码备份 | 博客侧边栏公告(支持HTML代码)(支持JS代码)

    博客侧边栏公告(支持HTML代码)(支持JS代码) <div id='btnList'> <a class="ivu-btn ivu-btn-primary" h ...

  3. Python 之 copy() 与 deepcopy() 之间的区别

    在 Python 之中,如果想要复制一个对象就免不了要理解浅复制与深复制.这也是 Python 与其他语言的区别之一. Python 的数据存储方式与其他语言不同.当你定义了一个变量: a = [, ...

  4. 英伟达GPU虚拟化---申请英伟达测试License

    此文基于全新的License 2.0系统,针对vGPU License的试用申请以及软件下载和License管理进行了详细的说明,方便今后我们申请测试License,快速验证GPU的功能. 试用步骤: ...

  5. Git 的简单使用及ssh配置问题-赖大大

    软件安装 第一步当然是安装啦. 官方网址:https://git-scm.com/ 具体操作 在你本地电脑的文件夹里右击鼠标,选Git base here 显然,你是在本地仓库的master分支上,通 ...

  6. 【ES】Java High Level REST Client 使用示例(增加修改)

    ES提供了多种编程语言的链接方式,有Java API,PHP API,.NET API 官网可以详细了解 https://www.elastic.co/guide/en/elasticsearch/c ...

  7. 2020年Java基础高频面试题汇总(1.4W字详细解析)

    1. Java语言有哪些特点 (1)简单易学.有丰富的类库 (2)面向对象(Java最重要的特性,让程序耦合度更低,内聚性更高) (3)与平台无关性(JVM是Java跨平台使用的根本) (4)可靠安全 ...

  8. Python编写“求一元二次方程的解”

    #求一元二次方程的解 import math def equation(a,b,c): h=b*b-4*a*c #一元二次方程的解,百度来的 if h>=0: x1=(-b+math.sqrt( ...

  9. loadrunner-事务

    自从安装了loadrunner之后,就没怎么用过它了,项目之前也没做过性能测试,所以学习起来比较困难,而且性能测试远远不止使用工具这么简单.下面介绍一下最近学习的loadrunner添加事务. 事务是 ...

  10. 第十七周Java实验作业

    实验十七  线程同步控制 实验时间 2018-12-10 1.实验目的与要求 (1) 掌握线程同步的概念及实现技术: 多线程并发运行不确定性问题解决方案:引入线程同步机制,使得另一线程使用该方法,就只 ...