简体   繁体   English

如何避免在网址中附加webapp名称?

[英]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.

相关问题 如何避免URL中的应用程序名称-RESTEasy Java 8 - How to avoid application name in URL - RESTEasy Java 8 如何为 Web 应用程序创建公共 URL - How to create a public url for a Webapp 重写规则,附加webapp上下文路径与 <spring:url> 和 <c:url> 标签库 - Rewrite Rule appending webapp context path conflicts with <spring:url> and <c:url> taglibs 如何避免pdfbox附加单独的单词 - How to avoid pdfbox appending separate words Java webapp:如何将webapp映射/定向到您的BASE URL / IP? - Java webapp : How to map/direct webapp to your BASE URL/IP? 如何从ExternalContext获取webapp的绝对URL? - How to get an absolute URL of webapp from ExternalContext? 如何在Spring中找到当前webapp的基本URL? - How to find the base URL of the current webapp in Spring? 如何避免从Webapp的应用程序上下文中检索Spring bean? - How to avoid retrieving spring beans from application context in webapp? 来自webapp1的Html5视频使用来自webapp2的源代码,如何避免将webapp2从外部网络暴露给浏览器 - Html5 video from webapp1 uses source from webapp2, how to avoid exposing webapp2 to browsers from external network 如何避免在第二次调用后在 ajax 上附加重复项? - How to avoid appending duplicates on ajax after second call?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM