发布了自己的web站点之后,想要访问站点文件夹下的某个文本文件,
但是却不知道怎么找到文件根目录,
一直尝试总是找不到文件……
好不容易在网上翻了堆代码找到两句我现在急用的……so
//根目录路径的获取
System.out.println(request.getSession().getServletContext().getRealPath("\\"));
//ArrowInfo文件路径的获取
System.out.println(request.getSession().getServletContext().getRealPath("文件名字"));
ps:----------
http://blog.csdn.net/songylwq/article/details/5771893