1

I created a webapp and I deployed it on tomcat.

But instead of http://ip:port I need to put http://ip:port/nameOfTheWarFile

to enter. is there a way to remove that name from the url and just use http://ip:port?

2 Answers2

2

Deploy the application as 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.

Based on the Tomcat documentation, you can deploy a web application with the base name equal to ROOT (i.e. ROOT.war or ROOT.xml) to achieve an empty context path:

Context Path   | Base File Name | Example File Names 
Empty String   | ROOT           | ROOT.xml, ROOT.war, ROOT
Serban Petrescu
  • 5,127
  • 2
  • 17
  • 34
Stefan
  • 12,108
  • 5
  • 47
  • 66
0

You will need to change the context path of your web application. Another user had a similar question and was answered here.

How to set the context path of a web application in Tomcat 7.0