Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1890996
  • 博文数量: 606
  • 博客积分: 9991
  • 博客等级: 中将
  • 技术积分: 5725
  • 用 户 组: 普通用户
  • 注册时间: 2008-07-17 19:07
文章分类

全部博文(606)

文章存档

2011年(10)

2010年(67)

2009年(155)

2008年(386)

分类:

2008-08-20 17:38:54

从request获取各种路径总结
request.getRealPath("url");//虚拟目录映射为实际目录
request.getRealPath("./");//网页所在的目录
request.getRealPath("../");//网页所在目录的上一层目录

request.getContextPath();//应用的web目录的名称

/bookStore/ => [contextPath] (request.getContextPath())

获取Web项目的全路径
String strDirPath = request.getSession().getServletContext().getRealPath("/");
阅读(796) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~