This project was taken from the online exam https://github.com/Eliteteams/q...
But when IDEA is compiled, an error occurs: Cannot resolve symbol 'HttpServletRequest''HttpServletResponse' 'Cookie'
I have these three jars. The strange thing is that when my project runs, the correct page pops up. What is wrong with this? Already?
Add this sentence to pom.xml
Setting scope to provided means that the running environment has been provided and is only used for compilation and will not be packaged.
It is not recommended to put the servlet on the classpath, after all, different projects may require different versions.
Additional sentence: Please select the servlet-api version according to the project's web.xml, or select a new servlet-api version to modify the header of web.xml
This is a maven project, there is no need to manually import packages. Right click on the project MAVEN->Update Project
The compilation environment does not have javax.servlet-api.jar
The operating environment has this
Add javax.servlet-api.jar
Add a reference to tomcat, this is the easiest way