limq

          rainman
          隨筆 - 19, 文章 - 2, 評論 - 115, 引用 - 1
          數(shù)據(jù)加載中……

          Servlet 路徑

          首先建立一個測試頁面:path.jsp
          <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
          <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<html>
          <head>
          <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
          <title>無標(biāo)題文檔</title>
          </head>

          <body>
          請求服務(wù)器:
          <%= request.getServerName() %><br>
          使用協(xié)議:
          <%= request.getProtocol() %><br>
          請求方法:
          <%= request.getMethod() %><br>
          請求斷口號:
          <%= request.getServerPort() %><br>
          Context路徑:
          <%= request.getContextPath() %><br>
          Servlet路徑:
          <%= request.getServletPath() %><br>
          URI路徑:
          <%= request.getRequestURI() %><br>
          查詢字串:
          <%= request.getQueryString() %><br>
          <br>
          使用者主機(jī)IP:
          <%= request.getRemoteAddr() %><br>

          <%= request.getRemotePort() %>
          </body>
          </html>

          再用一下方式測試:
          http://localhost:8080/WebModule1/path.jsp?name=justin&nick=caterpillar

          結(jié)果為:
          請求服務(wù)器: localhost
          使用協(xié)議: HTTP/1.1
          請求方法: GET
          請求斷口號: 8080
          Context路徑: /WebModule1
          Servlet路徑: /path.jsp
          URI路徑: /WebModule1/path.jsp
          查詢字串: name=justin&nick=caterpillar

          使用者主?CIP: 127.0.0.1
          1490

          posted on 2005-03-01 23:29 limq 閱讀(4575) 評論(1)  編輯  收藏

          評論

          # re: Servlet 路徑   回復(fù)  更多評論   

          大神,我首先得到協(xié)議是http1.1 ,我現(xiàn)在要在后臺把他改成https的可以嗎?
          2012-05-29 14:27 | 柯可

          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 东至县| 衡阳县| 阳西县| 安岳县| 常山县| 札达县| 称多县| 明星| 巩留县| 长治市| 应用必备| 阿瓦提县| 南投市| 襄樊市| 嫩江县| 孝义市| 凭祥市| 南乐县| 东城区| 虞城县| 西盟| 临安市| 延庆县| 绥中县| 丹江口市| 景泰县| 彭泽县| 海晏县| 澎湖县| 吴江市| 渝北区| 辽阳县| 正镶白旗| 汤阴县| 剑河县| 宾阳县| 景德镇市| 桐城市| 华容县| 泰安市| 鸡西市|