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>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Insert title here</title>
            <style type="text/css">
                body{
                    background-color: azure;
                }
                form{
                    position: fixed;
                    top: 250px;
                    left: 650px;
                    background-color: #ADD8E6;
                    border-radius: 5px;
                }
                div{
                    font-size: 22px;
                    margin-top: 20px;
                    padding-left: 40px;
                }
                input{
                     200px;
                    height: 20px;
                    border-radius: 5px;
                }
                #tj{
                     80px;
                    height: 30px;
            
                    margin-left: 140px;
                        border-radius: 5px;
                        font-size: 16px;
                        margin-bottom: 20px;
                }
            </style>
            
    </head>
    <body>
        <form action="/school/panduanServlet" method="post">
                    <div>账 号:    <input type="text" name="username"></div>
                    <div>密 码:    <input type="text" name="password"></div>
                    <div>验 证 码:<input type="text" name = "yanzhengma"> <img   src="getcode" alt="看不清,换一张" onclick="change(this)"/></div>
                    <div><input type="submit" id="tj" value="登录" ></div>
                </form>
    
    </body>
    <script type="text/javascript">
        function  change(img) {
            img.src = "getcode?"+new Date().getTime();
            
        }
    </script>
    </html><%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
    <%
        String name=request.getParameter("uname");
        String password=request.getParameter("upassword");
        if(name.equals("zs")&&password.equals("123")){
            request.getRequestDispatcher("ok.jsp").forward(request,response);
        }else{
            request.getRequestDispatcher("no.jsp").forward(request,response);
        }
     %><%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
      </head>
      
      <body>
          <h1>登陆成功</h1>
      </body>
    </html>
  • 相关阅读:
    elementui问题汇总
    微信小程序实现微信授权登录
    微信小程序数据存储
    小程序使用第三方服务,需要中转到一个h5页面,返回到指定页面
    小程序开发,通过左上角返回到指定页面
    万恶之源-基本数据类型(list,tuple)
    基础中的基础
    mybatis_plus实现自动填充和逻辑删除
    本地端口占用解决方案
    maven定义版本以来报红解决方案
  • 原文地址:https://www.cnblogs.com/liu11xiansheng/p/14597815.html
Copyright © 2011-2022 走看看