Use the latest version of IDEA (2020.3.2) to deploy the Tomcat server


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

Insert picture description here
Select the folder address of Tomcat
Insert picture description here

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...
Insert picture description here
Click the "+" sign, click the "Local" as shown in the figure below, and the
Insert picture description here
warning will usually appear at the bottom. Click the "Fix" on the right
Insert picture description here
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.
Insert picture description here

Select the browser you want to run, here is the default browser of the system.
Insert picture description here
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
Insert picture description here

Insert picture description here
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
Insert picture description here
, and where there is an error in the running process, where to change
Insert picture description here

3. When deploying, some details

The name can be changed (for the convenience of recording)
Insert picture description here
If the computer has multiple Tomcat versions installed, you can select the required version.
Insert picture description here
If the port name is prompted, the port number can be modified here.
Insert picture description here
When the project source code changes, the server's corresponding operation selection
Insert picture description here

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.
Insert picture description here
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

Insert picture description here

4. Other

If all the above problems are eliminated, you
can use the debug tool of idea and the debug tool
Insert picture description here
of browser
Insert picture description here

Guess you like

Origin blog.csdn.net/m0_50654102/article/details/114527391