A Sling Servlet with DS Annotations (default for Maven 12/13 Archetype) looks like this:
/**
* Servlet that writes some sample content into the response. It is mounted for
* all resources of a specific Sling resource type. The
* {@link SlingSafeMethodsServlet} shall be used for HTTP methods that are
* idempotent. For write operations use the {@link SlingAllMethodsServlet}.
*/
@Component
(service=Servlet.
class
,
property={
Constants.SERVICE_DESCRIPTION +
"=Simple Demo Servlet"
,
"sling.servlet.methods="
+ HttpConstants.METHOD_POST,
"sling.servlet.paths="
+
"/bin/myDataSourcePoolServlet"
})
public
class
SimpleServlet
extends
SlingAllMethodsServlet {