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

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
    </head>
    <body>
        <h1 style="color:red">登陆成功!</h1>
        <%
            String uname = request.getParameter("uname");
            String upwd = request.getParameter("upwd");
        %>
        用户名为:<%=uname%><br> 密码为:<%=upwd%>
    </body>
    </html>
    

      

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>register</title>
    <style type="text/css"></style>
    </head>
    <body>
    
        <form action="login.jsp" method="post">
            用户名:<input type="text" name="uname"><br> 密 码:<input
                type="password" name="upwd"><br> <input type="submit"
                value="提交">
        </form>
    
    </body>
    </html>
    

      

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
    </head>
    <body>
        <h1 style="color:red">登录失败!</h1>
        <form action="register.jsp" method="post">
            <input type="submit" value="返回">
        </form>
    </body>
    </html>
    

      

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>login</title>
    </head>
    <body>
        <%
            String uname = request.getParameter("uname");
            String upwd = request.getParameter("upwd");
            if (uname.equals("zs") && upwd.equals("123"))
    
                request.getRequestDispatcher("OK.jsp").forward(request,
                        response);
            else
                request.getRequestDispatcher("NO.jsp").forward(request,
                        response);
        %>
    
    </body>
    </html>
    

      

  • 相关阅读:
    zip加密-字符串加密成字符串
    语言学习第一天
    localStorage和sessionStorage数据存储
    ValueOf()和toString()
    call()与apply()区别typeof和instanceof的区别
    javaScript判断手机型号
    HTML&CSS
    Doctype 严格模式与混杂模式-如何触发这两种模式,区分它们有何意义?
    获得地址栏内的参数
    私有变量
  • 原文地址:https://www.cnblogs.com/wxyailjy/p/14597131.html
Copyright © 2011-2022 走看看