servlet取绝对路径问题
系统是Suse 64位企业版服务器,tomcat6.0.24,PathServlet.java负责取得tomcat的绝对路径,在XP下面没问题,到Suse下就取不到了。想请教各位一下!谢谢!
PathServlet.java代码:
public class PathServlet extends HttpServlet {
public void init() throws ServletException {
String realPath = getServletContext().getRealPath("/WEB-INF/conf/");
}
}