HttpServlet cannot be resolved to a type … is this a bug in eclipse?

后端 未结 5 544
别跟我提以往
别跟我提以往 2020-12-28 14:19

Every thing was fine and i was able to run this JSP project, suddenly some thing happened and mostly all my servlets getting unresolved error.

I know its because sp

5条回答
  •  孤城傲影
    2020-12-28 14:43

    It happened for me also and the reason was selecting inappropriate combination of tomcat and Dynamic web module version while creating project in eclipse. I selected Tomcat v9.0 along with Dynamic web module version 3.1 and eclipse was not able to resolve the HttpServlet type. When used Tomcat 7.0 along with Dynamic web module version 7.0, eclipse was automatically able to resolve the HttpServlet type.

    Related question Dynamic Web Module option in Eclipse

    To check which version of tomcat should be used along with different versions of the Servlet and JSP specifications refer http://tomcat.apache.org/whichversion.html

提交回复
热议问题