Error details
1. Click File ---> then click Project Structure
2. Select Modules, then select your project and go to Dependencies, click the "+" sign to select Library... this option
3. If the Tomcat server is configured, there will be the option Tomcat xxxx [if there is no configuration, follow the tomcat server configuration tutorial to configure] and then click Add Selected (add selected), and finally click OK after clicking Apply.