What is Sling Servlet? | AEM Community Blog Seeding | Community
Skip to main content
kautuk_sahni
Community Manager
Community Manager
June 6, 2022

What is Sling Servlet? | AEM Community Blog Seeding

  • June 6, 2022
  • 0 replies
  • 546 views

BlogImage.jpg

What is Sling Servlet? by Heena Shirke

Abstract

Sling Servlet enables us to expose OSGI Service based on request - response model.

Every Sling Servlet must implement the Servlet interface which defines its lifecycle methods.

It must either extend SlingSafeMethodsServlet or SlingAllMethodsServlet

Servlet can either be path based(tagged to a specific paths) or resource based(tagged to specific resource types).


Lets create our first servlet:

Register Servlet as an OSGI component.

@Component(
service={Servlet.class},
property={"sling.servlet.methods=post", "sling.servlet.paths=/bin/sampleservlet"})

Read Full Blog

What is Sling Servlet?

Q&A

Please use this thread to ask the related questions.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.