0

I followed the official spring tutorial "Converting a Spring Boot JAR Application to a WAR using Maven" link.

The generated war file is deployed on tomcat and is accessible at:

a)http://localhost:8080/${AppName}/
http://localhost:8080/gs-convert-jar-to-war-maven-0.1.0/  in case of the tutorial.

Which configs do I need to change to make my application directly available at

http://localhost:8080/  (without the appName) 

while running my war file on tomcat?

Thanks,

Ron

Ron
  • 319
  • 1
  • 3
  • 10
  • Should have been more diligent with with research. Answered here: http://stackoverflow.com/questions/18413723/deploy-war-file-on-tomcat-and-run-without-project-name?rq=1 – Ron May 27 '14 at 08:13

1 Answers1

0

You have to change the contextRoot of your application. There is 3 places where you can do that:

  • in a file in the WAR: META-INF/context.xml
  • in TOMCAT_HOME/conf/Catalina/localhost/xxx.xml
  • or in server.xml file but it's better not to change it here.

In one of these places, you can add this:

<Context
        path="/"
        docBase="/TOMCAT_HOME/webapps/yourapp"
    />
lpratlong
  • 1,421
  • 9
  • 17