posts - 241,  comments - 116,  trackbacks - 0
          一個獲取servlet,jsp,或其它java http請求的參數方式。

           

          // 處理所有參數

          Enumeration e = request.getParameterNames();

          while(e.hasMoreElements()){
          String paramName = (String)e.nextElement();
          怪蜀黍

          String paramValue = (String)request.getParameter(paramName);
          // 處理參數名paramName與參數值paramValue
          }

           

          //獲取請求頭信息

                Enumeration e = request.getHeaderNames();
                while (e.hasMoreElements()) {
                    String name = (String)e.nextElement();
                    String value = request.getHeader(name);
                    out.println(name + " = " + value);
                }
          posted on 2011-10-19 10:38 墻頭草 閱讀(250) 評論(0)  編輯  收藏

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


          網站導航:
           
          人人游戲網 軟件開發網 貨運專家
          主站蜘蛛池模板: 巨鹿县| 潢川县| 周宁县| 疏附县| 大渡口区| 荔波县| 高密市| 电白县| 余姚市| 辽阳市| 永嘉县| 开阳县| 太康县| 诸暨市| 武清区| 安多县| 卢氏县| 滨海县| 红桥区| 临澧县| 徐水县| 峡江县| 三原县| 招远市| 桐梓县| 额敏县| 常德市| 铜梁县| 丁青县| 秦安县| 友谊县| 合川市| 常德市| 田阳县| 沾益县| 岫岩| 沙湾县| 南皮县| 河东区| 青田县| 兴化市|