request.getScheme() 使用方法
2015-12-22 00:00
453 查看
今天在看代码时,发现程序使用了 request.getScheme() 。不明白是什么意思,查了一下。结果整理如下:
1、request.getScheme() 返回当前链接使用的协议;一般应用返回http;SSL返回https;
2、在程序中的应用如下:
3、复习一下request 的常用方法:
request.getSchema()可以返回当前页面使用的协议,http 或是 https;
request.getServerName()可以返回当前页面所在的服务器的名字;
request.getServerPort()可以返回当前页面所在的服务器使用的端口,就是80;
request.getContextPath()可以返回当前页面所在的应用的名字;
1、request.getScheme() 返回当前链接使用的协议;一般应用返回http;SSL返回https;
2、在程序中的应用如下:
<% String path = request.getContextPath(); String basePath = request.getScheme()+ "://" +request.getServerName()+":" +request.getServerPort()+path+"/"; %> <head> <base href="<%=basePath%>"> </head>
3、复习一下request 的常用方法:
request.getSchema()可以返回当前页面使用的协议,http 或是 https;
request.getServerName()可以返回当前页面所在的服务器的名字;
request.getServerPort()可以返回当前页面所在的服务器使用的端口,就是80;
request.getContextPath()可以返回当前页面所在的应用的名字;
相关文章推荐
- JavaSE的UI界面编程
- CALayer 花瓣飘落 转场动画-CATransation 动画组 UIView动画封装
- iOS - UIImageView
- iOS- UIProgressView
- UI相关基础知识
- BlockQueue使用之简单应用
- UIScrollView,UITableView的简单使用
- Riemann积分和Lebesgue积分角度下一积分不等式的等号成立充要条件的研究
- MySQL提示:The server quit without updating PID file问题的解决办法
- 设置UILabel的行间距
- 关于很简单的设计模式,ui-dao-database,以及JavaBean和util工具类
- 笔记-引导页GuideActivity
- 子线程改变UI线程的方法
- UIScreen的scale属性
- LabVIEW如何将脚本插入Quick Drop
- dispatch_get_current_queue的废弃
- [uva] 10099 - The Tourist Guide
- NGUI 这一年填过的那些坑(不定时更新)
- Codeforces 597C Subsequences dp + 树状数组
- UILable的text设置中划线(删除线)