Looking for children's shoes for this problem I believe that IntelliJ IDEA, Tomcat download, JDK and other configurations should be completed, so I will go straight to the topic.
1. Create a new project
2. Since here we just show how to successfully deploy Tomcat and successfully run a jsp file after configuration is completed, I only checked JavaEnterprise-->Web Application-->Next. Maybe because I have configured it before, the Application Server column will show that there is already Tomcat, just ignore it.
3. Just default the project name. In order to quickly deploy Tomcat, these are not the key points. Click Finish and wait for IntelliJ IDEA to load
4. Click the small triangle as shown in the figure, then click Edit Configurations-->Green plus sign-->If there is no in the list, then-->Click 33 items more irrelevant to continue searching.
Tomcat Server-->Local
5.
Click "Configure..." to configure the Tomcat you downloaded from the official website of Apache, the file directory after the decompression of the zip compressed package, mine is apache-tomcat-9.0.0.M13. And I didn't configure it. It was positioned by the IDE itself and it was very smart. I was surprised at that time.
6. Select a browser
I'm using Firefox and configure the firefox.exe path. I suggest using Firefox or Chrome, a must-have for developers.
7. Configure artifacts. The first time I forgot to configure it, I don’t understand what this thing is for. After running Tomcat, an error will be reported. The error message is:
[RMI TCP Connection(2)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal One or more Filters failed to start.
Official statement: https://www.jetbrains.com/help/idea/2016.3/configuring-web-application-deployment.html (I can't bear to translate it in English) Click Fix
The tag jumps from Server to Deploment, click the icon like a small pencil to configure artifacts
Create a new folder --> Green plus sign --> Directory Content Select the location where the web is stored, of course it is Tomcat's webapps. The generated war file can only be deployed in this project to run on the Tomcat server. Run index directly in the web folder. jsp file, do the final verification.
The above is all the content of this article. I hope it will be helpful to everyone's learning and I hope everyone will support Wulin.com more.