zoukankan      html  css  js  c++  java
  • Rquest对象代码练习

    1.代码练习

    <%@ 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 'index.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>
        <font color="blue">表单提交的信息:</font><br>
               输入的第1个数据是:<%=request.getParameter("shuju1") %><br>
               输入的第2个数据是:<%=request.getParameter("shuju2") %><br><br>
        <font  color="red">客户端信息:</font> <br>
              客户端协议名和版本号:<%=request.getProtocol() %><br/>
              客户机名:<%=request.getRemoteHost() %> <br>
             客户机的IP地址:<%=request.getRemoteAddr() %><br>
             客户提交信息的长度:<%=request.getContentLength() %><br/>
              客户提交信息的方式:<%=request.getMethod() %><br>
        HTTP头文件中的Host值:<%=request.getHeader("Host") %><br>
              服务器名 :<%=request.getServerPort() %><br>
              服务器端口号:<%=request.getServerPort() %><br>
             接受客户提交信息的页面:<%=request.getServletPath() %><br/>
      </body>

    运行截图

  • 相关阅读:
    技术人员转型秘笈
    2007 Office System Beta2 Technical Refresh 下载
    使用Word 2007写blog
    SharePoint WebPart 用户控件包装器 HandsOn Labs
    将Office SharePoint Server 2007 Beta2安装到DC上
    Visual Studio Tools for Office “v3” CTP!
    QuickPart : 用户控件包装器 for SharePoint 2007
    Office SharePoint Server 2007 !
    说说ASP.NET 2.0的书
    闫辉的书:《程序员,建立你的商业意识》
  • 原文地址:https://www.cnblogs.com/frankzone/p/7655254.html
Copyright © 2011-2022 走看看