简体   繁体   English

从Tomcat网址中删除文件夹名称

[英]Remove Folder Name From Tomcat url

I created a webapp and I deployed it on tomcat. 我创建了一个Webapp,并将其部署在了Tomcat上。

But instead of http://ip:port I need to put http://ip:port/nameOfTheWarFile 但是我需要放置http:// ip:port / nameOfTheWarFile而不是http:// ip:port

to enter. 进入。 is there a way to remove that name from the url and just use http://ip:port ? 有没有一种方法可以从网址中删除该名称,而只使用http:// ip:port

Deploy the application as ROOT.war . 将应用程序部署为ROOT.war

If you do not want the application name to be inside the URL and to access the application directly on a URL like " http://ip:port ", then it means that you want an empty context path for your web app. 如果您不希望应用程序名称位于URL内,并且不希望直接通过“ http:// ip:port ”之类的URL访问该应用程序,则意味着您希望为Web应用程序提供一个空的上下文路径

Based on the Tomcat documentation , you can deploy a web application with the base name equal to ROOT (ie ROOT.war or ROOT.xml ) to achieve an empty context path: 根据Tomcat文档 ,您可以部署基本名称等于ROOT的Web应用程序(即ROOT.warROOT.xml )以实现空的上下文路径:

Context Path   | Base File Name | Example File Names 
Empty String   | ROOT           | ROOT.xml, ROOT.war, ROOT

You will need to change the context path of your web application. 您将需要更改Web应用程序的上下文路径。 Another user had a similar question and was answered here. 另一个用户也有类似的问题,并在此处得到回答。

How to set the context path of a web application in Tomcat 7.0 如何在Tomcat 7.0中设置Web应用程序的上下文路径

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM