• jsp第4个作业(2)


    <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <base href="<%=basePath%>">
        
        <title>My JSP 'one.jsp' starting page</title>
        
        <meta http-equiv="pragma" content="no-cache">
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="expires" content="0">    
        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
        <meta http-equiv="description" content="This is my page">
        <!--
        <link rel="stylesheet" type="text/css" href="styles.css">
        -->
    
      </head>
      
      <body>
            <%
                request.setCharacterEncoding("utf-8");
                String user=request.getParameter("u_name");
                String pwd=request.getParameter("u_pswd");
             %>
             <%
                 if(user.equals("lucky") && pwd.equals("123456")){
            out.print("你好,"+user+"!");
            //登陆成功
            request.getRequestDispatcher("two.jsp").forward(request, response);
        }else{
            response.sendRedirect("index.jsp");
            
            }
        %>
    
      </body></html>
    <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <base href="<%=basePath%>">
        
        <title>My JSP 'two.jsp' starting page</title>
        
        <meta http-equiv="pragma" content="no-cache">
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="expires" content="0">    
        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
        <meta http-equiv="description" content="This is my page">
        <!--
        <link rel="stylesheet" type="text/css" href="styles.css">
        -->
    
      </head>
      
      <body>
            你好,Lucky!<br>
      </body>
    </html>
    <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
    
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
       <title>登录验证</title>
      </head>
     <body>
        <form action="one.jsp" method="post" >
            <table align="center">
            <tr>
                <td><img src="Snap1.jpg"><div style="position:absolute; left: 650px; top: 216px;  356px;">
                    <table align="right">
                        <tr>
                            <td align="right">用户名:&nbsp;</td>
                            <td height="27"><input type="text" name="u_name" size="20"/><br></td>        
                        </tr>
                        <tr>
                            <td align="right">密码:&nbsp;</td>
                            <td height="27"><input type="password" name="u_pswd" size="20"/><br></td>        
                        </tr>
                        
                        <tr>
                            <td>
                                <div style="position:absolute; left: 200px; top: 80px;  356px;">
                                    <input type="image" src="login.gif" width="101" height="22" border="0" name="submit" value="提交" />
                                </div>
                            </td>        
                        </tr>
                        
                    </table>
                        </div>
                    </td>
                </tr>
            </table>
        </form>
    </body>
    </html>

     

  • 相关阅读:
    对MFC文档、视图、框架的理解
    MFC中快速将CVIew转换成CScrollView
    MFC中的一个错误
    单文档中视图与文档的相互
    python函数
    python模块介绍和引入
    python面向对象和面向过程
    python数据类型2
    python数据类型
    python无法使用input功能
  • 原文地址:https://www.cnblogs.com/Suzy-an/p/12607800.html
Copyright © 2020-2023  润新知