/**
* Register Multiple Selectors in Servlet.
*/
@component(service = Servlet.class, immediate = true, property = { "description=Multiple Selectors Servlet",
ServletResolverConstants.SLING_SERVLET_METHODS + "=" + HttpConstants.METHOD_GET,
ServletResolverConstants.SLING_SERVLET_RESOURCE_TYPES + "=sling/servlet/default",
ServletResolverConstants.SLING_SERVLET_SELECTORS + "=selector1",
ServletResolverConstants.SLING_SERVLET_SELECTORS + "=selector2",
ServletResolverConstants.SLING_SERVLET_EXTENSIONS + "=json" })
@SuppressWarnings("serial")
public class MultipleSelectorServlet extends SlingSafeMethodsServlet {
private static Logger log = LoggerFactory.getLogger(MultipleSelectorServlet.class);
@Override
protected void doGet(final SlingHttpServletRequest req, final SlingHttpServletResponse resp)
throws ServletException, IOException {
try {
Page path to accessing the same page with different selectors in the same servlet.
/myproject.selector1.json
/myproject.selector2.json
Thank You.
Keshav Chaurasiya