Idea configures tomcat to start a web project graphic tutorial

Idea configures tomcat to start a web project graphic tutorial

Configure tomcat

1. Click run configuration

insert image description here

2. Select tomcat local

insert image description here

3. Configure tomcat

insert image description here

4. Deploy web project

There are 2 ways to deploy
war package: package it into war and run it on the server. This method is more common.
war exploded: upload the web project to the server in the location relationship of the current folder. Just move the folders, jsp pages, classes, etc. directly to the Tomcat deployment folder for loading and deployment. Therefore, this method supports hot deployment and is generally used during development.

The way to get the absolute context path is different:
String contextPath = request.getSession().getServletContext().getRealPath("/");

We are using war exploded for demonstration.

insert image description here

We have already generated it here. If it is not generated, you can generate it manually.

insert image description here

Select Deployment

insert image description here
insert image description here

The suffix of application context and url should be the same, otherwise 404 will appear.
Start tomcat

Summarize

This is the end of this article about idea configuration tomcat to start web project. For more related idea configuration tomcat to start web project content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to use IDEA to create a web project and publish it to tomcat
  • How to remove the embedded Tomcat in Spring Boot and start it in a non-web way
  • Detailed explanation of the process of deploying Tomcat and creating the first web project in IDEA 2020.3.1
  • Tomcat first deployment web project process diagram
  • Solve the problem that the files under WEB-INF/classes are not compiled after tomcat releases the project
  • Solve the problem that SpringBoot webSocket resources cannot be loaded and tomcat startup errors
  • IDEA graphic tutorial on configuring Tomcat server and publishing web projects
  • Alibaba Cloud Server Linux System Builds Tomcat to Deploy Web Project
  • Briefly describe how to install Tomcat image and deploy web project in Docker
  • Analysis of the process of deploying pure HTML files in Tomcat and WebLogic
  • IDEA2020.1.2 Detailed tutorial on creating a web project and configuring Tomcat
  • How to configure Tomcat and run your first Java Web project on IntelliJ IDEA 2018
  • Java web project starts Tomcat error solution
  • Tomcat source code analysis of Web requests and processing

<<:  Determine whether MySQL update will lock the table through examples

>>:  Steps for Django to connect to local MySQL database (pycharm)

Recommend

How to avoid garbled characters when importing external files (js/vbs/css)

In the page, external files such as js, css, etc. ...

CSS3 to achieve simple white cloud floating background effect

This is a very simple pure CSS3 white cloud float...

MySQL database table partitioning considerations [recommended]

Table partitioning is different from database par...

Installation tutorial of the latest stable version of MySQL 5.7.17 under Linux

Install the latest stable version of MySQL on Lin...

Tutorial on using Webpack in JavaScript

Table of contents 0. What is Webpack 1. Use of We...

Implementing a web calculator based on JavaScript

This article shares the specific code of JavaScri...

MySQL cursor principle and usage example analysis

This article uses examples to explain the princip...

Dynamically edit data in Layui table row

Table of contents Preface Style Function Descript...

How to update Ubuntu 20.04 LTS on Windows 10

April 23, 2020, Today, Ubuntu 20.04 on Windows al...

VUE render function usage and detailed explanation

Table of contents Preface The role of render Rend...

MySQL joint index effective conditions and index invalid conditions

Table of contents 1. Conditions for joint index f...

Native Js implementation of calendar widget

This article example shares the specific code of ...