eclipse项目发布到tomcat后的默认部署路径

eclipse项目发布到tomcat后的默认部署路径是不确定的,但是可以通过在项目中打印的方式显示eclipse默认的部署路径,比如在springmvc中

String basePath=ContextLoader.getCurrentWebApplicationContext().getServletContext().getRealPath("/") ;
System.out.println(basePath);

这样就可以在控制台看到路径了。

原文地址:https://www.cnblogs.com/passer1991/p/3524016.html