Chinaunix首页 | 论坛 | 博客
  • 博客访问: 52131
  • 博文数量: 6
  • 博客积分: 170
  • 博客等级: 入伍新兵
  • 技术积分: 70
  • 用 户 组: 普通用户
  • 注册时间: 2009-04-30 11:20
文章分类

全部博文(6)

文章存档

2009年(6)

我的朋友
最近访客

分类: Java

2009-05-12 14:54:53

替代方法是:

request.getSession().getServletContect().getRealPath()得到站点的绝对地址

在Servlet 和Struts中还可以用

this.getServletContect().getRealPath("/");

this.getServlet().getServletContect().getRealPath("/");

阅读(2249) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~