zoukankan      html  css  js  c++  java
  • JSP第四次作业(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 'login.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>
     <form action="dologin.jsp" method="post">
     用户名<input type="text" name="uname"><br>
    密码<input type="password" name="umima"><br>
     <input type="submit" name="登录"><br>
     
     </form>
      </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 'huanying.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>
        <h3>你好:lucky!</h3>
       
      </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 'dologin.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 name=request.getParameter("uname");
        String mima=request.getParameter("umima");
        if(name.equals("lucky")&&mima.equals("123456")){
        request.getRequestDispatcher("huanying.jsp").forward(request,response);
        }else{
         request.getRequestDispatcher("login.jsp").forward(request,response);
        }
         %>
      </body>
    </html>

  • 相关阅读:
    模块二 GO语言进阶技术-panic函数、recover函数以及defer语句(上)
    模块二 GO语言进阶技术-错误处理(下)
    模块二 GO语言进阶技术-错误处理(上)
    模块二 GO语言进阶技术-if语句、for语句和switch语句
    模块二 GO语言进阶技术-GO语句及其执行规则(下)
    模块二 GO语言进阶技术-go语句及其执行规则(上)
    模块二 GO语言进阶技术-关于指针的有限操作
    模块二 GO语言进阶技术-接口类型的合理运用
    模块二 GO语言进阶技术-结构体及其方法的使用法门
    模块二 GO语言进阶技术-使用函数的正确姿势
  • 原文地址:https://www.cnblogs.com/wangtianpeng/p/12584233.html
Copyright © 2011-2022 走看看