Deploy war on Tomcat without the war name in the URL
Here are two possible method:
- Rename your war to ROOT.war
- No need to rename. Go to
CATALINA_BASE/conf/server.xml
Find Host element and setautoDeploy="false"
deployOnStartup="false"
then add<Context path="" docBase="your_project_name"/>
in the end like:
expamle#2:
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="false" deployOnStartup="false">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
<Context path="" docBase="your_project_name"/><!--Add this-->
</Host>
All you need to do is name your war ROOT.war
.