zoukankan      html  css  js  c++  java
  • 3.24jsp

    <%@ page language="java" import="java.util.*" 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=ISO-8859-1">
    <title>Insert title here</title>
    <style>
        table{
            width: 200px;
            height:200px;
            text-align: center;
        }
    </style>
    </head>
      <script type="text/javascript">
        function reloadCode()
        {
          var time=new Date().getTime();
          document.getElementById("imagecode").src="<%= request.getContextPath()%>/servlet/ImageServlet?d="+time;
        }
      </script>
    <body>
    登录<br/>
        <form action="dologin.jsp" name="myform"  "<%= request.getContextPath()%>/servlet/UserServlet" method="post" >
    用户名:<input type="text" name="uname"><br/>
    密码:<input typut="password" name="upwd"><br/>
     验证码:<input  type="text" name="checkCode"/>
        <a href="javascript:reloadCode();">
          <img alt="验证码" id="imagecode" src="<%= request.getContextPath()%>/servlet/ImageServlet"/>
          看不清楚</a><br>
       <input type="submit" value="登录">
       <form/>
    </body>
    <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
    
    <% 
    
        String name = request.getParameter("uname");
    
        String pwd  = request.getParameter("upwd");
        
        if(name.equals("zs") && pwd.equals("123"))
    
            request.getRequestDispatcher("ok.jsp").forward(request, response);
    
        else
    
            request.getRequestDispatcher("no.jsp").forward(request, response);
    
    
    %>
    <%@ page landuage="java"  import ="java.util.*" pageEncoding="utf-8"%>
    <% 
        request.setCharacterEncoding("utf-8");
        String name = request.getParameter("uname");
        String pwd = request.getParameter("upwd");
        
    
    %>
    你注册的姓名是<%=name%><br/>
    你注册的密码是<%=pwd%><br/>
    <%@ 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=ISO-8859-1">
    <title>Insert title here</title>
    <style>
        table{
            width: 200px;
            height:200px;
            text-align: center;
        }
    </style>
    </head>
    
    <body>
    <h1  style="color: green">登录成功</h1>
    </body>
    </html>

     

  • 相关阅读:
    Ext JS 学习笔记
    ASP中令人震撼的Debug类(VBScript)
    texttransform的使用
    综合搜索引擎代码
    做技术,切不可沉湎于技术
    站长常用广告代码的表达大全
    ASP中一个字符串处理类(加强)(VBScript)
    Asp中一些FSO方面的函数
    没有Javascript,纯CSS下拉菜单IE,FF
    ASP中一个字符串处理类(VBScript) 原版
  • 原文地址:https://www.cnblogs.com/zjzj123/p/14589031.html
Copyright © 2011-2022 走看看