AD0-E137 practice question 1 of 10

A developer is asked to create an Adobe Experience Manager servlet MyServlet that listens for HTTP requests capable of handling the GET method. The…

Choose your answer, then check it against the explanation.

A developer is asked to create an Adobe Experience Manager servlet MyServlet that listens for HTTP requests capable of handling the GET method. The servlet must be registered using Declarative Services (OSGi) and be bound to a specific resource type /my/resourcetype allowing it to serve requests for a particular component. What is the correct way to register a servlet? A) @SlingServletResourceTypes(resourceTypes ="/my/resourcetype", methods = {"get"}) public class MyServlet extends SlingSafeMethodServlet { @Override protected void doGET(SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServletException, IOException { // Handle get request } } B) @SlingServletResourceTypes(resourceTypes="/my/resourcetype", methods = { "GET" }) public class MyServlet extends SlingAllMethodsServlet { @Override protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServletException, IOException { // Handle get request } } C) @SlingServletResourceTypes(resourceTypes ="/my/resourcetype", methods = { "get" }) public class MyServlet extends SlingSafeMethodServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // Handle get request } }
Answer options
Question 1 of 10

Keep practicing

Take the free AD0-E137 practice test

Ten exam-style questions with answers and explanations, plus the exam facts and study guides.

Start the free practice test

More questions

Other AD0-E137 practice questions

Scroll to Top