当我从JSF
运行Eclipse IDE
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
?如何在该目录中部署
我有一个解决方案,在Eclipse的vm
处更改Edit lunch configuration properties
参数的路径。