今天在修改bug時,發現程式使用了 request.getscheme() 。不明白是什麼意思,在google 搜尋了一下。現在明白了。整理如下:
1、request.getscheme() 傳回目前連結使用的協定;比如,一般應用傳回http;ssl傳回https;
2、在程式中的應用如下:

request.getschema()可以傳回目前頁面使用的協定,http 或是 https;
request.getservername()可以傳回目前頁面所在的伺服器的名字;
request.getserverport()可以傳回目前頁面所在的伺服器使用的端口,就是80;
request.getcontextpath()可以傳回目前頁面所在的應用的名字;