If I want to implement a servlet that doesn't necessarily map to a resource, is it possible to extend HttpServlet, rather than, for example, SlingAllMethodsServlet, but still access the javax.jcr.Session for the currently logged in user?
Yes, although I'm not sure why you would want to do that. If you just have a regular HttpServlet registered with Sling, you can get the current ResourceResolver by doing:
Yes, although I'm not sure why you would want to do that. If you just have a regular HttpServlet registered with Sling, you can get the current ResourceResolver by doing: