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?
Asked
Active
Viewed 1,189 times
0

Vishnu Haridas
- 7,355
- 3
- 28
- 43

sai kiran
- 1
- 3
-
possible duplicate of https://stackoverflow.com/questions/1363605/tomcat-base-url-redirection – DanielM Jul 03 '18 at 16:52
2 Answers
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
-
i tried it,but its not working.application is running at localhost:8080/myapplication – sai kiran Jul 04 '18 at 10:45