1
2
3
4
5
String path = request.getContextPath(); 
   
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"
   
<base href="<%=basePath%>"

  

request.getSchema()可以返回当前页面使用的协议,http 或是 https;

request.getServerName()可以返回当前页面所在的服务器的名字;

request.getServerPort()可以返回当前页面所在的服务器使用的端口,就是80;

request.getContextPath()可以返回当前页面所在的应用的名字;

最新文章

  1. java.net.ConnectException: Connection timed out
  2. phpspidercookie
  3. AlwaysOn可用性组测试环境安装与配置(二)--AlwaysOn配置(界面与T-SQL)
  4. postman 添加环境变量 并 读取变量 作为参数 传入,跑整个场景
  5. Spring中加载配置文件的方式
  6. mybatis整合spring 之 基于接口映射的多对一关系
  7. SpringBoot相关
  8. iframe-摘自网友
  9. 13年省赛-B题-连通分量
  10. Microsoft Visual Studio 2013 Update 1 离线安装程序
  11. c#利用WebClient和WebRequest获取网页源代码
  12. soj 1698 Hungry Cow_三角函数
  13. Weapsy 分析网站架构
  14. idea + mybatis generator + maven 插件使用
  15. linkin大话数据结构--Google commons工具类
  16. wpf图片浏览器,实现缩放平移操作图片切换等功能
  17. TreeNode.trage的使用
  18. Mysql SQL分组取每组前几条记录
  19. Java接口自动化测试之HTTPClient学习(四)
  20. npm 是干什么的

热门文章

  1. lvm调整分区大小
  2. redis 的部分配置
  3. AWK学习总结(三) Records and Fields
  4. H264 介绍[1]
  5. Keepalived+lvs 搭建高可用负载均衡
  6. jQuery.uploadify文件上传组件实例讲解
  7. 【SCOI 2007】 降雨量
  8. Unity项目 - Boids集群模拟算法
  9. StackOverflow 创始人关于如何高效编程的清单
  10. ACM_抢糖果