Problem: When deploying a project on tomcat, you need to add the project name to access it, but there is no project name on the request, so it will cause a request 404
Modify server.xml in the conf folder under tomcat
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
<Context path="" docBase="D\demo" reloadable="false" />
</Host>
docBase represents the absolute path of the project, you can also use a relative path, the project folder will be generated after jar and war are executed
Original address: https://www.jianshu.com/p/101fc24cd5d1