将webapp从Eclipse部署到Tomcat根上下文 [英] deploy webapp from Eclipse to Tomcat root context
问题描述
这样做很棒,但默认情况下,该项目部署到Tomcat的 / web
上下文中,因为项目名称为 web
。有没有办法可以从Eclipse部署到Tomcat,而不需要将项目名称更改为ROOT?
您需要转到服务器视图
..双击tomcat,这将打开一个新窗口(带2个选项卡)。选择一个说 Modules
,你的应用程序将被列在那里(带有上下文路径)。您可以从/ web将上下文路径从这里更改为其他任何东西。
或者,您可以打开server.xml查找名为context的标签。在这个标签中,您将会找到/ web。/更改它。
I deploy a .war application from Eclipse by adding the "Dynamic Web Module" facet, then right-clicking on the project and selecting "Run As -> Run on Server".
This works great, but by default the project is deployed to the /web
context of Tomcat, because the project name is web
. Is there a way I can deploy from Eclipse to Tomcat without changing the project name to ROOT?
You need to go to Server View
.. double click on tomcat, this opens a new window (with 2 tabs). Select the one which says Modules
, your application would be listed there (with the context path). You can change the context path from /web to anything else from here.
Alternatively, you can open server.xml look for a tag called context. within this tag you'll find the contextroot as /web.. change it.
这篇关于将webapp从Eclipse部署到Tomcat根上下文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!