Error:
The import javax.servlet cannot be resolved
The import javax.servlet.http.HttpServletRequest cannot be resolved
Description:
We often assume that other people project their own copy to the secondary development here or reference, sometimes above error occurs,
That eclipse project where we import the project can not be referenced in the prompt HttpServletRequest, accompanied by headache red cross appears.
Accuse:
There are specific reasons for our project web-inf / lib directory. Less appropriate package: Package javax.servlet.http caused;
Popular talk is a lack of precise and servlet-api.jar under TOMCAT_HOME \ lib.
I import someone else's project, he was in someone else's machine configured Server, usually tomcat, while those library Server is in the process of copying is not copied along with the project, unless someone else put the library has been copied to tomcat WEB-INF \ lib under.
Action:
Project -> Properties -> Java Build Path -> Add Library -> Server Runtime -> next -> 选择你的Server -> Finish
Original link: https: //blog.csdn.net/iteye_8546/article/details/82279120