ITeye博客

得到web项目的真实路径

weishuwei · 2007-04-12 14:23 · 问题拾遗 · Markdown

@Override
 public void init(ServletConfig config) throws ServletException {
  // TODO Auto-generated method stub
  
  ServletContext application =config.getServletContext();
  String realPath=application.getRealPath("/");
//  得到http://localhost:8080/项目上下文/
 }

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。