It is divided into two major steps: Project configuration and Tomcat configuration.
First, the project configuration
Open idea, select Import Item
After selecting the project path to be opened, continue to select the project's original type (subsequent boot settings will be updated to the idea project based on the original project type), in this case select Eclipse, and then keep next
File->project structure open the Project configuration window
To configure JDK versions and compilation levels in project items
Configure the project structure in the Sources tab of the modules item (main configuration Java files and configuration files to be compiled
Configure the post-compilation file output path in the Paths tab of the modules item
Configuring dependencies in the Dependencies tab of the modules item
Because the Eclipse project was selected when importing the project, the dependencies are handled automatically here, if the manual configuration is primarily a jar package with JDK and web-inf/lib.
There is a red wavy line error in the item name indicated in the picture, and all the red items in the dependency are deleted (some of the red Eclipse related items in the figure are because the project was originally opened in Eclipse, which is not required in idea).
Configure the required libraries in the Libraries key. Because the project needs to use JSP and servlet, and there is no relevant jar package in the project Lib, we introduce Js-api.jar, Servlet-api.jar in the Tomcat_home/lib directory.
To add a Web module to a project in the facets item
Modify the Web resource by clicking on the location indicated in the image. Idea default directory is the Web, our project is Webroot, so note the need to modify here.
To set the deployment configuration for a project in the artifacts key
Add webapplication:exploded
Can be further configured if necessary, is added after the default configuration no more Settings
Second, Tomcat configuration
Click on the icon in the upper right corner of the interface to open the run environment configuration
Add Tomcat Runtime Environment
Configure the Tomcat path, port
Add the project you want to deploy in the Deployment tab, and you can see that the deployment operation adds "Build ' Epcsys:war exploded ' artifact"
Click to run Tomcat when the Tomcat configuration is complete
Import an eclipse-written Web project into idea deployment to Tomcat