Hi, maybe you can try with this. these are properties of a servlet restricted for a specific resource type, on get method, with xml extension and a selector.
I use these for define a sitemap servlet on the homepage. (same as you can do with acs commons).
@Component(service = { Servlet.class }, property = {
"sling.servlet.resourceTypes=" + "fs_news/components/structure/hp_page", "sling.servlet.methods=" + "GET",
"sling.servlet.extensions=" + "xml", "sling.servlet.metatype=" + "true",
"sling.servlet.selector=" + "sitemap",
})
And this is the get method override:
@Override
protected void doGet(SlingHttpServletRequest slingRequest, SlingHttpServletResponse slingResponse)
throws ServletException, IOException {