Tutorial on downloading, installing and deploying Tomcat to IDEA (with two hot deployment setting methods for IDEA)

Tutorial on downloading, installing and deploying Tomcat to IDEA (with two hot deployment setting methods for IDEA)

When using Idea, after modifying the code, you need to restart Tomcat repeatedly to check the effect. Isn’t it annoying? I still remember when I first started using idea, I blindly configured and deployed Tomcat. As a result, I had to restart the server every time I modified a jsp. How could a Taurus programmer like me tolerate this? ~At this time you have to smash your computer~At this time you can add hot deployment to the project, which will greatly save development efficiency!

@

Tomcat Download Tutorial

In fact, downloading is very simple. As for why I added the word "tutorial" ~ because it sounds good and easy to pronounce ~

Official website address - click to enter http://tomcat.apache.org/

Tomcat installation tutorial

Just unzip it and the installation is over. However, the unzip path should not be the C drive, as it may cause various strange problems such as access denied. Also, the unzip path should not contain Chinese characters or special characters, remember! ! !

Hot deployment of Tomcat to IDEA

The default file of IntelliJ Idea is saved automatically. However, when a jsp file of a project is changed, Tomcat cannot respond to the change immediately, so hot deployment is required.

Look here: If you find it annoying, you can ignore the long string of text below ~ I am just Photoshopping ~, it is completely OK to just follow the pictures! ! !

In the server configuration of idea tomcat, there is an on frame deactivation, select update classes and resources. There is also a configuration on update action, which is what action to take when manually operating. You can restart the server or update the class and resource files as above. I chose Redeploy. However, the current project does not have the option to update classes and resources, but there is a Hot Swap classes. This is due to the type of artifact added by the server. Generally, a module corresponds to two types of artifacts, one is war and the other is war explored. war means it is released in the form of a war package. The current project is in this form. In this form, the on frame deactivation configuration does not have the update classes and resources option. war explored is the published file directory. If you select this form, the update classes and resources option will appear in on frame deactivation. The specific operations are as follows:

At this point, Tomcat hot deployment is on the idea, over~

Idea two hot deployment setting methods

The second method: add corresponding dependencies in pom.xml (not recommended). As for why it is not recommended, it is because there is not so much spare time in later development to pay attention to whether hot deployment coordinate dependencies are introduced. It is better to configure it directly on idea. As the saying goes, one effort brings one hundred benefits! ! ! The specific operation is similar to the following

<!--Support hot deployment dependencies-->
  <dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-devtools</artifactId>
   <scope>runtime</scope>
   <optional>true</optional>
  </dependency>

At this point, two methods have been explained. Hey, isn’t this just one method? I’ll give you a thumbs up... Brother, don’t be impulsive and don’t rush to give me a thumbs up. The first method is the setting that comes with idea, which has been configured above! Waving my claws, goodbye~ The classmate who wants to butt my fei, don't leave after school~...

Summarize

The above is the tutorial on how to download, install and deploy Tomcat to IDEA (with two hot deployment setting methods of IDEA). I ​​hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • IntelliJ IDEA Tomcat hot deployment configuration tutorial
  • IntelliJ IDEA uses Maven to implement hot deployment of Tomcat
  • A brief discussion on hot deployment of Tomcat7
  • Detailed explanation of hot deployment and hot loading methods of Tomcat
  • Tutorial on hot deployment of Tomcat using idea

<<:  The linkage method between menu and tab of vue+iview

>>:  MySQL replication mechanism principle explanation

Recommend

Detailed explanation of CSS elastic box flex-grow, flex-shrink, flex-basis

The functions of the three attributes flex-grow, ...

MySQL database implements MMM high availability cluster architecture

concept MMM (Master-Master replication manager fo...

Detailed Tutorial on Installing MySQL 5.7 on RedHat 6.5

RedHat6.5 installation MySQL5.7 tutorial sharing,...

Node.js solves the problem of Chinese garbled characters in client request data

Node.js solves the problem of Chinese garbled cha...

React example of how to get the value of the input box

React multiple ways to get the value of the input...

vue-table implements adding and deleting

This article example shares the specific code for...

Should I abandon JQuery?

Table of contents Preface What to use if not jQue...

Introduction to MySQL database performance optimization

Table of contents Why optimize? ? Where to start?...

Nginx configuration PC site mobile site separation to achieve redirection

Use nginx to configure the separation of PC site ...

Summary of the main attributes of the body tag

bgcolor="text color" background="ba...

Analysis of several situations where MySQL index fails

1. Best left prefix principle - If multiple colum...

Mysql modify stored procedure related permissions issue

When using MySQL database, you often encounter su...

Implementing a distributed lock using MySQL

introduce In a distributed system, distributed lo...

Using js to realize dynamic background

This article example shares the specific code of ...