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>

     

  • 相关阅读:
    html5学习系列之ef类标签
    html5学习系列之cd标签
    Java学习系列——xml学习基础
    html5学习系列——b标签
    为什么我要使用Linux,使用Linux的十个理由。
    设置Linux系统的空闲等待时间TMOUT的方法和Linux反空闲设置的两种方法
    创建动态MSSQL数据库表的方法
    SQL SERVER 自增列的方法
    XtraBackup构建MySQL主从环境的方法
    如何查看MySQL执行计划呢?
  • 原文地址:https://www.cnblogs.com/zjzj123/p/14589031.html
Copyright © 2011-2022 走看看