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>

  • 相关阅读:
    计算机注销、热启动、冷启动
    从高处理解android与服务器交互(看懂了做开发就会非常的容易)
    Android—Work—1day
    软件需求分析方法
    Android 常用控件的介绍
    android中Json的一些应用
    java数据传递例子+内存分析
    android中MVP模式
    android的四层体系结构,基于mvc三层结构浅析
    java
  • 原文地址:https://www.cnblogs.com/wangtianpeng/p/12584233.html
Copyright © 2011-2022 走看看