将webapp从Eclipse部署到Tomcat根上下文 [英] deploy webapp from Eclipse to Tomcat root context

查看:120
本文介绍了将webapp从Eclipse部署到Tomcat根上下文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过添加动态Web模块构面,然后右键单击该项目并选择运行方式 - >在服务器上运行,从Eclipse部署.war应用程序。



这样做很棒,但默认情况下,该项目部署到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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆