[英]How to avoid appending webapp name in the url?
I went through the link deploy war file on Tomcat and run without project name and I found that the question being asked is exactly the same that I'm having. 我在Tomcat上浏览了链接部署war文件并在没有项目名称的情况下运行 ,发现所问的问题与我遇到的问题完全相同。
But the answers confused me a bit. 但是答案让我有些困惑。 So first of all I want to know whether this can be achieved by not modifying the Tomcat installation directory at all !
因此,首先,我想知道是否可以通过完全不修改Tomcat安装目录来实现! If yes then please suggest me a concrete way to achieve my objective.
如果是的话,请给我建议实现目标的具体方法。
Also, my environment settings is like I'm building war with the help of maven. 另外,我的环境设置就像我在Maven的帮助下进行战争。 And, the server path(ie catalina.base) and deploy path is set as my workspace in eclipse IDE, in the server view.
并且,服务器路径(即catalina.base)和部署路径在eclipse IDE中的服务器视图中设置为我的工作空间。
By reading the above link deploy war file on Tomcat and run without project name 通过阅读以上链接,可以在Tomcat上部署war文件并在没有项目名称的情况下运行
You can simply removed the other apps(from tomcat's webapps dir) and change the application's name to ROOT and deploy it to tomcat. 您可以简单地删除其他应用程序(从tomcat的webapps目录中)并将该应用程序的名称更改为ROOT并将其部署到tomcat。
In case of maven project change it in your pom.xml(inside project tag) as : 如果是Maven项目,请在您的pom.xml(内部项目标签)中将其更改为:
<project ...>
<groupId>UR_PKG_NAME</groupId>
<artifactId>ROOT</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<build>
<finalName>ROOT</finalName>
.
.
.
</project>
Also you need to provide the Url of the running tomcat server in pom.xml(inside tomcat7 plugin configuration tag) as : 另外,您需要在pom.xml(在tomcat7插件配置标记中)中提供正在运行的tomcat服务器的网址,如下所示:
<url>http://IP:PORT/manager/text</url>
<server>tomcat</server><!-- the name of server in your maven settings.xml -->
<update>True</update>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.