[Solved] IDEA: JSP Could Not Use session Build-in Object

Problem description


since the author uses Tomcat 10, the servlet dependency used is Jakarta Servlet. For details, see building a servlet using Tomcat 10. An error is reported: class XXX is not a servlet. The error is because the servlet API package is not imported.


Import servlet API dependencies.

<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->

Similar Posts: