Using Tomcat 10 to build a servlet, an error is reported: class XXX is not a servlet

Exception report

resolvent

Abnormal cause

After Tomcat 10, the servlet dependent package is no longer javax.servlet, but jakarta.servlet.

terms of settlement

Use a version of Tomcat below 10. Modify the dependency to the latest Jakarta. Servlet.

Similar Posts: