0

I want to run a basic servlet application using Tomcat server. While trying run application on the server,the URL pattern is localhost:8080/myapplication/login. Is there any way to run the whole application using localhost:8080 only?

Vishnu Haridas
  • 7,355
  • 3
  • 28
  • 43
sai kiran
  • 1
  • 3

2 Answers2

1

It depends on how exactly does the application run, in which container, etc.

For example, in Tomcat, by default, the context path (myapplication in the question) is created because of the name of the WAR (myapplication.war)

In order to run without context path at all, rename the war into ROOT.war and deploy

Mark Bramnik
  • 39,963
  • 4
  • 57
  • 97
0

You can Define a context in the <Tomcat>/conf/server.xml file as follows

<Host name="localhost"  appBase="webapps" ...>
      ...
      <Context path="/" docBase="myapplication.war"/>
      ...
</Host>
Talha Ahmed Khan
  • 15,043
  • 10
  • 42
  • 49