![BlogImage.jpg](https://static.wixstatic.com/media/2c375d_4d49e9d9e1b1435e88d7f920a212152d~mv2.png/v1/fill/w_432,h_117,al_c,q_95/2c375d_4d49e9d9e1b1435e88d7f920a212152d~mv2.webp)
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
Q&A
Please use this thread to ask the related questions.
Kautuk Sahni