WebServlet cannot be resolved to a type

Try adding servlet-api.jar instead of servelt-api-3.0 jar.Stop the server. Refresh the project and then start the server and see. I think it should work. Make sure you are adding the servlet-api.jar from tomcat lib folder. Suppose your tomcat is in C:\Tomcat\lib. In eclipse right click your project-properties-javabuildpath-add external jars and then select the servlet-api.jar from your tomcat folder

Leave a Comment