【发布时间】:2020-02-23 13:21:29
【问题描述】:
当我从Eclipse IDE 运行JSF Web 应用程序时,我找不到目录(myjsfapp)。我知道该应用程序将部署在<tomcat home>/webapps 目录中。
这就是为什么,我从我的程序中打印出real-path,如下所示。
Object context = FacesContext.getCurrentInstance().getExternalContext().getContext();
String systemPath = ((ServletContext) context).getRealPath("/");
System.out.println(systemPath);
真实路径是
<my-workspace>\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\myjsfapp\
为什么myjsfapp 不部署在<tomcat home>/webapps?我该怎么做才能部署到那个目录
【问题讨论】: