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

后端 未结 5 567
别跟我提以往
别跟我提以往 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:33

    You have to set the runtime for your web project to the Tomcat installation you are using; you can do it in the "Targeted runtimes" section of the project configuration.

    In this way you will allow Eclipse to add Tomcat's Java EE Web Profile jars to the build path.

    Remember that the HttpServlet class isn't in a JRE, but at least in an Enterprise Web Profile (e.g. a servlet container runtime /lib folder).

提交回复
热议问题