What is a Servlet? A Servlet is a class used to extend capabilities of servers that host applications accessed by means of a request-response programming model; we know most the HTTP protocol.
In AEM, Servlets are typically registered as an OSGI service. The reference of the “sling.servlet.paths” or “sling.servlet.resourceTypes” must be set, or the Servlet service will be ignored.
Thank you!