How to achieve the war package in the springboot project, below I provide a link, you can refer to it yourself.
It is important to talk about the title.
First, just put the war file in the webapps folder, and then double-click the file in the bin folder
to start the war package. After
the first startup, open the project and note that the path is http://localhost:8080 (tomcat configuration file server. The port number in the xml configuration file
)/(the prefix of the war package name in the webapps folder) to start the project.
For example, mine is
the path where I started the project is http://localhost:8080/lock
After opening the project, I found that static resources such as js, css, png, etc. could not be loaded. At this time, just
add this to the host tag in the server.xml file
<Context docBase="F:\apache-tomcat-8.5.56\webapps/lock/WEB-INF/classes/static/bower_components/" path="/bower_components/"/>
<Context path="/dist/" docBase="F:\apache-tomcat-8.5.56\webapps/lock/WEB-INF/classes/static/dist/"/>
Configure it. As shown below:
The background color of the idea log is adjusted. The
idea springboot project is started, and the breakpoint is invalid. The
springboot project opens the war package: The
war package is deployed to tomcat for operation:
In this life, persistence or non-persistence is not terrible, what is afraid is to walk alone on the road of persistence! ! !