About using the latest version of IDEA (2020.3.2) to deploy the Tomcat server
Tomcat server:
https://download.csdn.net/download/m0_50654102/15132617?spm=1001.2014.3001.5501
Note: The jdk corresponding to the project must be installed in advance (you need to select the corresponding jdk folder during the installation process)
Specific steps
Integrate tomcat with IDEA
操作:File ——>Settings ——> Build——> Execution——> Deployment ——> Application Servers——>"+"号——>Tomcat Server
Select the folder address of Tomcat
Specific steps of project deployment
1. Create a Javaweb project
Refer to
https://blog.csdn.net/m0_50654102/article/details/113480150?spm=1001.2014.3001.5501
If you open the old project, ignore this step
2. Deploy Tomcat server
Click Edit Configurations...
Click the "+" sign, click the "Local" as shown in the figure below, and the
warning will usually appear at the bottom. Click the "Fix" on the right
to replace the default war package of the Application context at the bottom with the web project name created in step 1 (or old Project war package name), remember to add "/" on the left.
Select the browser you want to run, here is the default browser of the system.
And check if the URL is correct (as shown in the picture above)
If there is no problem, click "OK" in the lower right corner, now the server is successfully deployed and ready to run
Click to run
F12, start crud to
add code, refresh (if refreshing does not update the page, go back to the above to see if the update operation is correct)
where to mark the red change
, and where there is an error in the running process, where to change
3. When deploying, some details
The name can be changed (for the convenience of recording)
If the computer has multiple Tomcat versions installed, you can select the required version.
If the port name is prompted, the port number can be modified here.
When the project source code changes, the server's corresponding operation selection
Common bugs
1. Tomcat version problem
For example:
https://blog.csdn.net/m0_50654102/article/details/113751396?spm=1001.2014.3001.5501
2. The third-party jar package problem
It is recommended to import the jar package officially provided by Tomcat
Located in the lib of the Tomcat folder.
Other third-party jar package address download reference:
https://blog.csdn.net/m0_50654102/article/details/113828931?spm=1001.2014.3001.5501
3. The problem of xml file configuration
4. Other
If all the above problems are eliminated, you
can use the debug tool of idea and the debug tool
of browser