Create a deployable war file
If you just wanted to deploy the war file, packaged from IDE, to the standalone Tomcat, my suggestion may help you.
You must have looked up the Spring Boot Reference Guide/74.1 Create a deployable war file, then modified the
Application.java as above. However, there is also something you should do with your
Just modify the dependencies as follow:
According to the Tomcat 7 Documentation
Apache Tomcat version 7.0 implements the Servlet 3.0 and JavaServer Pages 2.2 specifications from the Java Community Process.
Thanks to Servlet 3.0’s supported, which allows you to configure your application with no
web.xml when it’s launched by the servlet container.
When you create a deployable jar file, thanks to the dependency as follow
servlet container has been embedded, so after you run
mvn spring-boot:run ,you can access to http://localhost:8088/hello. When you try create a deployable war file, and deploy it to standalone Tomcat, ensure that the embedded servlet container doesn’t interfere with the servlet container to which the war file will be deployed. Modification has been given as above.
So just modify the
pom.xml, then place the war file to …/webapp, run the standalone Tomcat, you can access to http://localhost:8080/WsTaxiShare/hello, and get the