Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Multiple Selectors in AEM Servlet | AEM Community Blog Seeding

Avatar

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,159 likes

Total Posts

6,259 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,159 likes

Total Posts

6,259 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile
kautuk_sahni
Community Manager

24-05-2021

BlogImage.jpg

Multiple Selectors in AEM Servlet by keshav chaurasiya

Abstract

You can use the multiple selectors in AEM Servlet. Please see the example below for the reference.

Your Page url : /content/en/aem-selector.selector1.selector2.json

Example :

@Component(service = Servlet.class, immediate = true, property = {

"description=Get AEM Selector ",

ServletResolverConstants.SLING_SERVLET_METHODS + "="

+ HttpConstants.METHOD_GET,

ServletResolverConstants.SLING_SERVLET_RESOURCE_TYPES + "=sling/servlet/default",

ServletResolverConstants.SLING_SERVLET_SELECTORS +"=selector1.selector2",

ServletResolverConstants.SLING_SERVLET_EXTENSIONS + "=json"})

@SuppressWarnings("serial")

public class AEMSelector extends SlingSafeMethodsServlet {

private static Logger log = LoggerFactory.getLogger(AEMSelector.class);

@Override

protected void doGet(final SlingHttpServletRequest request,

final SlingHttpServletResponse response) throws ServletException,

IOException {

log.debug("Enter in doGet method...");

}

Read Full Blog

Multiple Selectors in AEM Servlet

Q&A

Please use this thread to ask the related questions.

AEM AEMEBlogSeeding Experience Manager