今天在看代码时,发现程序使用了 request.getScheme() 。不明白是什么意思,查了一下。结果整理如下:
1、request.getScheme() 返回当前链接使用的协议;一般应用返回http;SSL返回https;
2、在程序中的应用如下:
3、复习一下request 的常用方法:
http://localhost:8080/demo/toPager.do 这是我的一个分页的页面
request.getSchema() 返回的就是当前使用的协议 http或者https
request.getServerName() 返回当前在服务器中的名字 如果是本机就是 localhost
request.getServerPort() 返回当前服务器的端口号 8080
request.getContextPath() 返回当前应用名 demo