Use Tomcat to deploy and start Web projects in Idea

First select Edit Run Configuration in Idea, as shown below

"+" in the upper left corner, select the Tomcat service, as shown below

Customize the service name and project access path in the browser

Configure the Tomcat server path, as shown below

 Then deploy the project in the server (the warning below: Warning: No artifacts marked for deployment Warning: There is no project marked for deployment), click the Deplyment option, click the "+" sign, select "Artifact", select "war exploded"

 

The difference between war and war exploded

war: Deploy the project to the server as a war package 
war exploded: Deploy the project to the server in relation to the location of the current folder

(1) war: Release mode, as you can tell from the name, it is first packaged into a war package and then released;

(2) war exploded: directly load folders, jsp pages, classes, etc. into Tomcat. Supports hot deployment and is recommended for development and learning.

Hot deployment settings

It should be noted that the "On Update action" we configured above refers to the "Refresh" button of the console, so this hot deployment method requires us to click the "Refresh" button to update resources

 

 Of course, we can also configure "On frame deactivation" to realize automatic monitoring, and automatically update the page immediately when resources are changed, without us manually clicking the "Refresh" button, but Idea's official recommendation is to set it to Do nothing, which can save idea consumption memory, more memory (32G or even 64G) can be ignored

After the configuration is successful, start the project and enter the access path in the browser to access the project! ! !

Important : Access paths can be modified in the run configuration! ! ! ! !

 

 

 

Guess you like

Origin blog.csdn.net/qq_42924347/article/details/128556963