limq

          rainman
          隨筆 - 19, 文章 - 2, 評論 - 115, 引用 - 1

          導航

          <2005年3月>
          272812345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          常用鏈接

          留言簿(19)

          我參與的團隊

          隨筆分類(5)

          隨筆檔案(20)

          文章檔案(1)

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          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>無標題文檔</title>
          </head>

          <body>
          請求服務器:
          <%= request.getServerName() %><br>
          使用協議:
          <%= 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>
          使用者主機IP:
          <%= request.getRemoteAddr() %><br>

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

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

          結果為:
          請求服務器: localhost
          使用協議: 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 閱讀(4579) 評論(1)  編輯  收藏

          評論

          # re: Servlet 路徑   回復  更多評論   

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

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


          網站導航:
           
          主站蜘蛛池模板: 电白县| 绥德县| 泰安市| 辽宁省| 玉屏| 垫江县| 荥经县| 增城市| 淮北市| 花莲市| 花垣县| SHOW| 东宁县| 青龙| 明水县| 昆明市| 云南省| 会宁县| 泸州市| 长顺县| 连平县| 惠来县| 老河口市| 洛川县| 邯郸县| 文化| 天峻县| 潢川县| 怀宁县| 台湾省| 托克托县| 油尖旺区| 渝中区| 龙游县| 彝良县| 棋牌| 利津县| 乐至县| 定结县| 四子王旗| 习水县|