• JSP第四周


    1.登录功能  用户名zs 密码123 登录成功  
    
    要求 有验证码功能  界面要美观
    <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
    <%
        String path = request.getContextPath();
        String basePath = request.getScheme() + "://"
                + request.getServerName() + ":" + request.getServerPort()
                + path + "/";
    %>
    
        <%
        String str = request.getParameter("address");
        String pwd = request.getParameter("key");
        if (null != str) {
            if (str.equals("jhn") && pwd.equals("200712")) {
                pageContext.forward("login.jsp");
            } else {
                out.println("您输入的账号或密码有误,请确认后重新输入!");
            }
        }
    %>
        
    
    <html>
    
    <head>
    <form action="" method="post"><br>
         账号:
         <input type="text" name="address" size="15"><br>
         密码:
         <input type="password" name="key" size="16.95"><br>
         验证码:
         <input type="text" name="7564" size="12">
         <img id="yzmtp" src="img/2.jpg" width="80px" height="30px"/>换一张<br>
         <input type="submit" value="登录" name="login">
         </form>
    
    
    </head>
    
    <body style="background:url(img/11.jpg)">
    
    
          
          
          
    
    </body>
    </html>
    <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
    + request.getServerName() + ":" + request.getServerPort()
    + path + "/";
    %>
    
     
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    
     
    
    </head>
    
    <body style="background:url(img/11.jpg)">
    welcome
    <br>
    
     
    
     
    
    
    </body>
    
    
    </html>
    
     
    

      

  • 相关阅读:
    ruby
    Ajax的基本请求/响应模型
    面向GC的Java编程(转)
    linux中fork()函数详解(转)
    详细解析Java中抽象类和接口的区别(转)
    MQ队列堆积太长,消费不过来怎么办(转)
    消息队列软件产品大比拼(转)
    mac地址和ip地址要同时存在么?
    DP刷题记录(持续更新)
    ZR979B. 【十联测 Day 9】唯一睿酱
  • 原文地址:https://www.cnblogs.com/1774ax/p/14594104.html
Copyright © 2020-2023  润新知