zoukankan      html  css  js  c++  java
  • JSP第四次作业

    登录功能  用户名zs 密码123 登录成功  

    要求 有验证码功能  界面要美观

    <%@ page language="java" contentType="text/html" 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("password");
        if (null != str) {
            if (str.equals("zs") && pwd.equals("123")) {
                pageContext.forward("MyJsp1.jsp");
            } else {
                out.println("您输入的账号或密码错误,请重新输入!");
            }
        }
    %>
    
    
    <html>
    <head>
    <form action="" method="post">
        <br> 账号: <input type="text" name="address" size="20"><br>
        密码: <input type="password" name="password" size="21"><br>
        验证码: <input type="text" name="2907" size="17"> <img id="yzmtp"
            src="aaa/23.jpg" width="120px" height="70px" />换一张<br> <input
            type="submit" value="登录" name="a">
    </form>
    </head>
    
    <body style="background:url(aaa/1.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+"/";
    %>
    <html>
      <head> 
      </head>
      <body style="background:url(aaa/1.jpg)">
            欢迎登录
    <br>
    </body>
    </html>

     

  • 相关阅读:
    VB.NET中lambda的写法
    C#中DllImport用法和路径问题
    SQL*Loader 和 Data Pump
    批处理-函数定义及应用01
    Office 2010 KMS激活原理和案例分享
    Hyper-V架构与VMware ESXi的差异
    Tomcat免安装配置2
    Tomcat免安装配置
    域名解析过程
    内部类访问的局部变量必须加final
  • 原文地址:https://www.cnblogs.com/LILY321/p/14594322.html
Copyright © 2011-2022 走看看