Error:
The import Javax.servlet cannot be resolved
The import javax.servlet.http.HttpServletRequest cannot be resolved
Description:
We often copy other people's projects to their own here for two times development or reference, sometimes the above error occurs,
In the Eclipse project we imported the project hint HttpServletRequest can not be quoted, will accompany the headache of the small red fork appear.
Accuse:
The specific reason is that we are in the project Web-inf/lib directory under the corresponding package: packages javax.servlet.http caused;
The popular and exact speaking is the lack of tomcat_home\lib under the Servlet-api.jar.
I import someone else's project, he configures the server on someone else's machine, it is generally tomcat, and the libraries of the server will not be copied with the project during the copy, unless someone else has copied the Tomcat library to web-inf\. Lib.
Action:
ADD Library, Server Runtime, Next, Java Build Path, Project--Properties--Select your server-Fi Nish
Project Import times wrong: The import javax.servlet.http.HttpServletRequest cannot be resolved