从Eclipse IDE运行时,Tomcat 7缺少部署目录

问题描述 投票:0回答:1

当我从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?如何在该目录中部署

java eclipse jsf tomcat7
1个回答
1
投票

我有一个解决方案,在Eclipse的vm处更改Edit lunch configuration properties参数的路径。

© www.soinside.com 2019 - 2024. All rights reserved.