request裡面的header資訊

2021-06-09 03:08:47 字數 2751 閱讀 6505

out.println("protocol: " + request.getprotocol()+"

"); 

out.println("scheme: " + request.getscheme()+"

"); 

out.println("server name: " + request.getservername()+"

" ); //獲得伺服器的名字 

out.println("server port: " + request.getserverport()+"

"); //獲得伺服器的埠號

out.println("rotocol: " + request.getprotocol()+"

"); 

out.println("server info: " + getservletconfig().getservletcontext().getserverinfo()+"

"); 

out.println("remote addr: " + request.getremoteaddr()+"

"); //獲得客戶端的ip位址 

out.println("remote host: " + request.getremotehost()+"

"); //獲得客戶端電腦的名字,若失敗,則返回客戶端電腦的ip位址

"); //獲得客戶端向伺服器端傳送資料的方法有get、post、put等型別

out.println("ath info: " + request.getpathinfo()+"

"); 

out.println("ath trans: " + request.getpathtranslated()+"

"); 

out.println("query string: " + request.getquerystring()+"

"); 

out.println("remote user: " + request.getremoteuser()+"

"); 

out.println("session id: " + request.getrequestedsessionid()+"

"); 

out.println("request uri: " + request.getrequesturi()+"

");//獲得發出請求字串的客戶端位址  

out.println("servlet path: " + request.getservletpath()+"

"); //獲得客戶端所請求的指令碼檔案的檔案路徑 

out.println(request.getheadernames()+"

"); //返回所有request header的名字,結果集是乙個enumeration(列舉)類的例項

out.println("accept: " + request.getheader("accept")+"

"); 

out.println("host: " + request.getheader("host")+"

"); 

out.println("referer : " + request.getheader("referer")+"

"); 

out.println("accept-language : " + request.getheader("accept-language")+"

"); 

out.println("accept-encoding : " + request.getheader("accept-encoding")+"

"); 

out.println("user-agent : " + request.getheader("user-agent")+"

"); //返回客戶端瀏覽器的版本號、型別 

out.println("connection : " + request.getheader("connection")+"

"); 

out.println("cookie : " + request.getheader("cookie")+"

"); 

out.println("created : " + session.getcreationtime()+"

"); 

out.println("lastaccessed : " + session.getlastaccessedtime()+"

");out.println("browsertype : " + request.getheader( " user-agent ")+"

");out.println("serverinfo: " + system.getproperty( "os.name ")+"

");

獲取Request裡面的一些引數等資訊

獲取request裡面的一些引數等資訊 接收到請求,記錄請求內容 記錄下請求內容 aop 類的類 class 資訊 signature.getdeclaringtype 獲取requestattributes requestattributes requestattributes requestco...

列舉裡面的介面的實現

列舉式乙個類,這個類,同樣也有類改由的功能,今天來說說列舉來實現介面。下面還是來看看 吧.首先我們定義乙個介面 介面裡面由兩個抽象方法.如下.public inte ce enuminte ce下滿我們來定義我們的列舉型別的類,分別由三個物件,分別有自己的構造方法.如下.public enum de...

Python裡面的字典

python 將這種資料型別叫做 dict 有的語言裡它的名稱是 hash 這兩種名字都會用到,不過這並不重要,重要的是它們和列表的區別。你看,針對列表你可以做這樣的事情 things a b c d print things 1 b things 1 z print things 1 z prin...