学生登陆查询系统

1 程序的主要功能及特点

实现一个登录界面的基本功能,具体要求:

  • 登录界面login.jsp含有表单,用户能够输入用户名和密码,并提交表单给verify.jsp。
  • Verify.jsp读取表单信息,并验证接收的用户名和密码是否与verify.jsp内置的相应变量值一致。
  • 如果一致,则转向页面success.jsp,显示"成功登录"并可以手动选择要查询的系统。
  • 如果不一致,则转向页面failure.jsp,显示"登录失败"并手动返回。
  • 本系统默认:用户名14347119密码wuxing为正确。

    2 程序部署及运行截图和相应说明(手工部署)

    部署

    • 成功登陆后可以选择登陆某一查询系统,见下图
    • 不成功登陆提示错误并返回,见下图

    SUCCESS LOGIN

    FAILURE LOGIN

    3 程序源代码

    login.jsp

     <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>loginPage</title>
    </head>
    <body bgcolor=AliceBlue >
    <form name="loginForm" method="post" action="verify.jsp">
    <center>
    <font size=6>学生微教务</font>
    </center>
    <center>
    <table>
    <tr>
    <td height="40" weight="100">UserName<input type="text" name="userName" id="userName"></td>
    </tr>
    <tr>
    <td height="40" weight="100">Password<input type="password" name="password" id="password"></td>
    </tr>
    <tr>
    <td><input type="submit" value="login" style="background-color:white"> <input type="reset" value="reset" style="background-color:yellow"></td>
    </tr>
    </table>
    </center>
    </form>
    </body>
    </html>

    verify.jsp

     <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Authentication</title>
    </head>
    <body>
    <%
    request.setCharacterEncoding("UTF-8");
    String name = request.getParameter("userName");
    String password = request.getParameter("password");
    if(name.equals("14347119")&& password.equals("wuxing")) {
    %>
    <jsp:forward page="success.jsp">
    <jsp:param name="userName" value="<%=name%>"/></jsp:forward>
    <%}
    else{
    %>
    <jsp:forward page="failure.jsp"></jsp:forward>
    <%}
    %>
    </body>
    </html>

    success.jsp

     <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Login Success</title>
    </head>
    <body bgcolor=AliceBlue>
    <form name="SUCCESS" method="post" action="JMP.jsp">
    <center>
    <%request.setCharacterEncoding("UTF-8");
    String name = request.getParameter("userName");
    out.println("Welcome:"+name);%><BR>
    </center>
    <center>
    <BR><font size="6">Score Query System</font><BR>
    <BR><font size="4">Please select one item to check</font>
    <Select name="grade" >
    <Option selected value="http://wjw.sysu.edu.cn">Academic performance</option>
    <Option value="http://cet.99sushe.com">CET-4 & CET-6</option>
    <Option value="http://chaxun.neea.edu.cn/examcenter/query.cn?op=doQueryCond&pram=results&sid=300"> NCRE</option>
    </Select>
    <BR><BR> <Input type="submit" value="submit" name="submit">
    </center>
    </body>
    </html>

    failure.jsp

     <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Login Failure</title>
    </head>
    <body bgcolor="Aliceblue">
    <center><font size="4">
    Incorrect username or password! Please return and try again.
    <BR><A href="login.jsp" >return
    </font>
    </center>
    </body>
    </html>

    JMP.JSP(用于跳转网站页面)

     <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JMP</title>
    </head>
    <body>
    <% String s=request.getParameter("grade");
    response.sendRedirect( s); %>
    </body>
    </html>

【JSP】简单登陆界面的更多相关文章

  1. Eclipse通过jdbc连接数据库制作简单登陆界面

    一.前言: 做网站开发,要求有多种搭配方式,前台技术可以使用PHP.ASP.JSP.ASP.NET.CGI等任何一种: 需要用到的基础语言用的最多的就是HTML/CSS.JS.JAVA.XML这些了, ...

  2. 🈲Eclipse通过jdbc连接数据库制作简单登陆界面【新手必看】

    一.前言: 做网站开发,要求有多种搭配方式,前台技术可以使用PHP.ASP.JSP.ASP.NET.CGI等任何一种: 需要用到的基础语言用的最多的就是HTML/CSS.JS.JAVA.XML这些了, ...

  3. 用asp连接Access数据库 制作简单登陆界面

    [题外话:最近做Internet作业,在这写一个适合初学入门的ASP连接ACCESS数据库做登陆界面的简单的例子,以慰藉我一口气把以前做过的系统中的PHP代码全改成ASP代码来临时应付作业的心情... ...

  4. 2017.10.20 jsp用户登陆界面连接数据库

    用户登陆界面 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8 ...

  5. pyqt5简单登陆界面

          登陆界面姓名输入错误会弹出错误信息.正确就会弹出第二个窗体. # -*- coding:utf-8 -*- import sys from PyQt5.QtWidgets import Q ...

  6. Flask入门之开发简单登陆界面

    涉及知识点: render_template() redirect():注意def的函数不要使用这个Python关键字 url_for():可以传参数给动态路由 动态路由 # Sample.py fr ...

  7. EditText简单登陆界面制作

  8. JSP制作简单登陆

    JSP制作简单登陆界面 运行环境 eclipse+tomcat+MySQL 不知道的可以参考Jsp运行环境--Tomcat 项目列表 这里我先把jsp文件先放在Web-INF外面访问 需要建立的几个文 ...

  9. Web 登陆界面---简单模块1

    今天学习登陆界面的基本模块,其中几个基本的元素 a元素.form元素.布局元素(table\tr\td).加粗(b).input元素 1.<a href="">内容&l ...

随机推荐

  1. 【Codeforces 467C】George and Job

    [链接] 我是链接,点我呀:) [题意] 让你从1..n这n个数字中 选出来k个不相交的长度为m的区间 然后这个k个区间的和最大 求出这k个区间的和的最大值 [题解] 设dp[i][j]表示前i个数字 ...

  2. Codeforces Problem 778B Bitwise Formula

    题目链接:http://codeforces.com/contest/779/problem/E 题意:有n个变量都可以用m位二进制数表示,这n个数的value将以两种格式中的一种给出 1.变量名, ...

  3. [BZOJ 3796]Mushroom追妹纸

    [BZOJ 3796]Mushroom追妹纸 题目 Mushroom最近看上了一个漂亮妹纸.他选择一种非常经典的手段来表达自己的心意——写情书.考虑到自己的表达能力,Mushroom决定不手写情书.他 ...

  4. noip模拟赛 可耻

    题目描述 给定一个长度为偶数的排列 p,你每次可以选取 p 排列中相邻的两个元素,假如分别是 x 和 y,那 么把 x 和 y 加入一个序列 q 的末尾,并将 x 和 y 从排列 p 中删除.重复上述 ...

  5. ZooKeeper可以用来做什么(转)

    在ZooKeeper的官网上有这么一句话:ZooKeeper is a centralized service for maintaining configuration information, n ...

  6. [转]使用代码去描述WCF配置文件

    转自:使用代码去描述WCF配置文件 在应用程序部署的时候,WCF客户端因为服务器地址的变化,需要修改程序配置文件的地址URL,手动修改很不方便,还会造成错误,所以尽量把描述WCF配置文件的配置使用代码 ...

  7. Spring面试总结

    Spring面试总结 文件夹(?)[+] 1.什么是spring框架?Spring框架有哪些主要模块? Spring框架是一个为Java应用程序的开发提供了综合.广泛的基础性支持的Java平台.Spr ...

  8. 【转】】}linux awk 命令详解

    http://www.cnblogs.com/ggjucheng/archive/2013/01/13/2858470.html ----------------------------------- ...

  9. [Angular] Remove divs to Preserve Style and Layout with ng-container in Angular

    The Angular <ng-container> is a grouping element that doesn't interfere with styles or layout ...

  10. 64位BASM学习随笔(一)

     64位BASM学习随笔(一) Delphi的BASM一直是我最喜爱的内嵌汇编语言,同C/C++的内联汇编相比,它更方便,更具灵活性,由于C/C++的内联汇编仅仅能是或插入式的汇编代码,函数花括号 ...