• 第一个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>电子登录系统</title>
    </head>
    <body>
    <center>
    
    <form action="examplejbdemo.jsp"   method="post">
    用户名:
    <input type="text" name="username">
    <br/><br/>&nbsp;&nbsp;码:
    <input type="text" name="password">
    <br/><br/>
    学  号:
    <input type="text" name="xuehao">
    <br/>
    <br/>        选填:<br>
    邮 箱:<input type="text" name="youxiang">
    <br/><br/>
    
    生 日:
    <input type="text" name="brithday">
    <br/><br/>
    身 高:
    <input type="text" name="higt">
    <br/><br/>
    <input type="submit" value="提交"/>
    </form>
    </center>
    </body>
    </html>
    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
        <%@page import="javabean.User" %>
    <!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>用户信息</title>
    </head>
    <body>
    <jsp:useBean id="userbean" scope= "page" class="javabean.User"/>
    <jsp:setProperty property="*" name="userbean"  />
    
    <%
        if("123".equals(userbean.getPassword()))
        {
            
             RequestDispatcher rd = request.getRequestDispatcher("NewFile.jsp"); 
             rd.forward(request,response); 
            
        }
        
    %>
    密码不是123,,没有跳转;
    </body>
    </html>
    <%@ 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>Insert title here</title>
    </head>
    <body>
    跳转成功;
    </body>
    </html>
  • 相关阅读:
    库函数(汇总)
    IE jQuery ajax 请求缓存问题
    Jarvis OJ-level3
    在64位的linux中运行32位的应用程序
    ROP之linux_x64知识杂记
    2017年网络空间安全技术大赛部分writeup
    Sniper OJ部分writeup
    gdb插件使用方法
    pwntools学习
    linux虚拟机安装值得注意的几点
  • 原文地址:https://www.cnblogs.com/zhangjiaqi123/p/8919898.html
Copyright © 2020-2023  润新知