1, stay eclipse Right click item , then Export choice WAR file, Build project's WAR file . Please refer to the picture for detailed steps :

2, Put the generated WAR File in tomcat After decompression webapps Under folder .


3, stay tomcat Of conf In the folder server.xml Configure :

      stay <Host></Host> Add the following code between labels :

       <Context path="/" docBase="F:/tomcat/webapps" debug="0"
reloadable="true" crossContext="true"> </Context>


  <Context docBase="D:\pafalearning\userapp\dist\tomcat\userapp.war"
path="/userapp" reloadable="true"/>

 docBase: Path to the root of the project , Because I made the project war package , So point directly at this war Just a bag ( My project is called :userapp). 
path: Is a virtual directory , This is set to "userapp", Start Tomcat
after , You will pass http://localhost:8080/userapp/*.jsp To access the relevant pages of the project . 
reloadable: If set to "true", It means when you modify jsp After document , Synchronization of page display can be realized without restarting the server . 
It can be understood in this way
: take docBase Items in actual directory , Map to ${tomcat.home}\webapps Virtual project under directory path( The configuration here refers to userapp project ).

4, start-up tomcat. double-click tomcat In the unzip file bin Under directory startup.bat.

5, Enter the corresponding address in the browser .