1

I was working with sample spring project , and all of the sudden the Jsp pages starts to

complain about absent of "jakarta.servlet.http.HttpServlet". Im not using any type of Jakarta

feature. My web service is Tomcat 9 and for JSP im using javax.servlet.jsp.jstl-1.2.1 and

javax.servlet.jsp.jstl-api-1.2.1. The project structure is Dynamic Web Project with these

setting :

enter image description here

and error :

enter image description here

Ahad Porkar
  • 1,666
  • 2
  • 33
  • 68

1 Answers1

4

http.HttpServlet mostly means you do not have a Tomcat for the project.

Right-click on the project > Properties > Project Facets > Runtimes, make sure that you checkmark the Tomcat > Apply.

If that does not work you can

Right-click on the project > Properties > Java Build Path > Add Library > Server Runtime, and select your Apache Tomcat 9

zawarudo
  • 1,907
  • 2
  • 10
  • 20
  • In the absence of both `javax.servlet.http.Servlet` and `jakarta.servlet.http.Servlet` WTP must return an incorrect error message. This should probably be reported as a bug (the Dynamic Web Module version is a `javax.*` one). – Piotr P. Karwasz Feb 11 '22 at 15:20
  • @PiotrP.Karwasz Exactly. Also the fun part is even with this error , project can be run an deployed correctly..... – Ahad Porkar Feb 11 '22 at 17:04
  • 1
    @AhadPorkar: JSPs are compiled by Tomcat at runtime, therefore Eclipse's _"error"_ is rather a warning that an error might occur. – Piotr P. Karwasz Feb 11 '22 at 17:59