zoukankan      html  css  js  c++  java
  • 第一个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>
  • 相关阅读:
    C++ 沉思录——Chap6:句柄2
    C++ 沉思录——Chap5:代理类
    C++ 沉思录——Chap4:设计类的核查表
    Linux 网卡驱动相关——01
    FCoE的提出
    想成为嵌入式程序员应知道的0x10个基本问题
    C++ 沉思录——Chap6:句柄
    C++ 沉思录——Chap8:一个面向对象程序范例
    数据库调优积累系列(1):索引
    QTP使用问题集锦
  • 原文地址:https://www.cnblogs.com/zhangjiaqi123/p/8919898.html
Copyright © 2011-2022 走看看