This article mainly describes how to add Servelet to idea, which is suitable for beginners and developers who convert from Eclipse development tools to IDEA
Environment introduction
System environment: win11
Development tool version: IntelliJ IDEA 2022.2.1
Project creation and configuration process
1. Create a Java project
2. Add frame support
3. Add classes directory
web-->WEB-INF-->classes
4. Copy the classes path
5. Configure the project structure Project Structure
ctrl+shift+alt+s
shortcut key open
paste path
Replace both places with the classes directory path
Click OK in the lower right corner to save
6. Import servelet-api.jar
ctrl+shift+alt+s
Shortcut key to open Project Structure
Follow the diagram
Then select the servelet-api.jar package in the lib directory in the local tomcat installation location
Click OK to save
7. Create a Servlet test
Finish