hk2000c技術專欄

          技術源于哲學,哲學來源于生活 關心生活,關注健康,關心他人

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            111 隨筆 :: 1 文章 :: 28 評論 :: 0 Trackbacks
          javax.servlet.http.Cookie

          JSESSIONID = 當前session 號碼

          org/apache/coyote/Request.java

          基本封裝類,包括基本request 信息

          其源代碼在此可以查看 http://www.docjar.com/html/api/org/apache/coyote/Request.java.html

           public Request() {
          72 
          73          parameters.setQuery(queryMB);
          74          parameters.setURLDecoder(urlDecoder);
          75          parameters.setHeaders(headers);
          76 
          77          methodMB.setString("GET");
          78          uriMB.setString("/");
          79          queryMB.setString("");
          80          protoMB.setString("HTTP/1.0");
          81 
          82      }
          83 

          開始初始化

          回收
           // -------------------- Recycling --------------------
          459
          460
          461     public void recycle() {
          462         bytesRead=0;
          463
          464         contentLength = -1;
          465         contentTypeMB = null;
          466         charEncoding = null;
          467         headers.recycle();
          468         serverNameMB.recycle();
          469         serverPort=-1;
          470         localPort = -1;
          471         remotePort = -1;
          472
          473         cookies.recycle();
          474         parameters.recycle();
          475
          476         unparsedURIMB.recycle();
          477         uriMB.recycle();
          478         decodedUriMB.recycle();
          479         queryMB.recycle();
          480         methodMB.recycle();
          481         protoMB.recycle();
          482         //remoteAddrMB.recycle();
          483         //remoteHostMB.recycle();
          484
          485         // XXX Do we need such defaults ?
          486         schemeMB.recycle();
          487         methodMB.setString("GET");
          488         uriMB.setString("/");
          489         queryMB.setString("");
          490         protoMB.setString("HTTP/1.0");
          491         //remoteAddrMB.setString("127.0.0.1");
          492         //remoteHostMB.setString("localhost");
          493
          494         instanceId.recycle();
          495         remoteUser.recycle();
          496         authType.recycle();
          497         attributes.clear();
          498     }

          偉大的method() 方法


           public MessageBytes method() {
          184         return methodMB;
          185     }
          186     

            getMethod() 方法就是從這里搞來的。

          還有 org.apache.tomcat.util.http.MimeHeader 存放了所有的Header 信息


          === MimeHeaders ===
          accept = image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
          referer = http://localhost/user/userRegister.html
          accept-language = zh-CN,en-US;q=0.5
          content-type = application/x-www-form-urlencoded
          ua-cpu = x86
          accept-encoding = gzip, deflate
          user-agent = Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.1; MAXTHON 2.0)
          host = localhost
          content-length = 70
          connection = Keep-Alive
          cache-control = no-cache
          cookie = JSESSIONID=06820B9CA579BF64CC89C5E041864459







          posted on 2007-10-27 19:52 hk2000c 閱讀(5766) 評論(0)  編輯  收藏 所屬分類: Java 技術
          主站蜘蛛池模板: 扶沟县| 平遥县| 武陟县| 承德市| 隆子县| 延庆县| 广丰县| 云龙县| 阿勒泰市| 长葛市| 沈丘县| 十堰市| 炎陵县| 醴陵市| 东平县| 新巴尔虎左旗| 桂东县| 勃利县| 绥棱县| 城固县| 宁乡县| 辽中县| 米易县| 任丘市| 绿春县| 赣榆县| 海丰县| 喀喇| 华安县| 罗江县| 奎屯市| 阿拉善左旗| 绥阳县| 深水埗区| 鄂托克旗| 进贤县| 肥东县| 泰宁县| 临颍县| 河南省| 宝应县|