//在调度器中获取ServletContext
WebApplicationContext context = ContextLoader.getCurrentWebApplicationContext();
ServletContext sc = null ;
if(context != null){
sc = context.getServletContext();
}
String projDir = "";//工程部署在本地的实际路径
if(sc != null){
projDir = sc.getRealPath("/"); 实际正确路径是 D:\servers\apache-tomcat-6.0.35\webapps\ivms\
}
打印后是 D:\servers\apache-tomcat-6.0.29\bin\
求大神解答,我在eclipse部署tomcat的路径就是 D:\servers\apache-tomcat-6.0.35\webapps\,但最后为什么不一样
------解决思路----------------------
server.xml,Eclipse 的和服务器的分别发下