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

WeChat applet implements countdown for sending SMS verification code

This article shares the specific code for the WeC...

Detailed explanation of the usage of grep command in Linux

1. Official Introduction grep is a commonly used ...

Detailed explanation of Linux CPU load and CPU utilization

CPU Load and CPU Utilization Both of these can re...

MySQL inspection script (must read)

As shown below: #!/usr/bin/env python3.5 import p...

Mysql method to copy a column of data in one table to a column in another table

mysql copy one table column to another table Some...

An article to teach you HTML

If you are not committed to becoming an artist, t...

Vue implements div wheel zooming in and out

Implement div wheel zooming in and out in Vue pro...

Detailed example of MySQL (5.6 and below) parsing JSON

MySQL (5.6 and below) parses json #json parsing f...

React-Native environment setup and basic introduction

Environment Preparation 1. Environment Constructi...

Summary of fragmented knowledge of Docker management

Table of contents 1. Overview 2. Application Exam...

How to use CSS attribute value regular matching selector (tips)

There are three types of attribute value regular ...

Talk about implicit conversion in MySQL

In the course of work, you will encounter many ca...

Founder font library Chinese and English file name comparison table

Founder Type Library is a font library developed ...