java类与jsp文件获取项目物理路径
jsp获取项目的物理路径:
String path = application.getRealPath("/");
效果如下:
java类文件获取物理路径:
ServletContext context = ServletActionContext.getServletContext();
String path = context.getRealPath("/*");
jsp获取项目的物理路径:
String path = application.getRealPath("/");
效果如下:
java类文件获取物理路径:
ServletContext context = ServletActionContext.getServletContext();
String path = context.getRealPath("/*");