Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的 Struts 2 项目运行良好。我通过命令行构建了它,一切都很顺利。我的最后一步是再次通过命令行部署到 tomcat:
mvn tomcat:run
在带有 pom 文件的文件夹中。那行得通-我可以通过浏览器点击该项目。但是当我将它导入 Eclipse 时;
文件 -> 导入 -> 现有 Maven 项目 -> MyProject
项目已导入,但无法从 Eclipse 运行。Run As -> Run on Server 下的选项不存在。
如何让该选项出现?
弄清楚了。右键单击项目文件夹,向下滚动到属性(或在 Windows 上按 Alt+Enter 快捷键)并选择项目构面。
从那里确保单击“动态 Web 模块”并选择“应用”。现在您应该可以在服务器上运行该项目了。