My IDEA version: 2022.2
I'm learning Java Web recently, and the textbook about adding Tomcat's Servlet-api.jar is not very clear. I checked it online and wrote down this note.
1.First, create a folder under the project named libs
2.Then, go to the folder where you downloaded Tomcat, find its subfolder [lib], and click to enter [lib]
3.Find servlet-api.jar in [lib], select it and copy It (can be copied with [Ctrl+C])
4.Copy it (you can [Ctrl+V]) to the newly created [libs] folder, and click [OK]
5.After that, right-click the servlet-api.jar
6.Select [Module Library], then click [Confirm]
7.Then find [Project Structure] in [File] and click [Project Structure]
8. The following page will pop up. Click [Module], then click [Web]. At the bottom of this page, select the root of src, and then click [Confirm] 】
9.At this time, go to [src], click New, and [Servlet] will appear
If it helps everyone, please give it a like!