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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Day 10 - Sling Servlets (Part II) | AEM Community Blog Seeding




Day 10 - Sling Servlets (Part II) by Redquark


In this post, we will take our discussion further and see how can we create servlets using resourceTypes.

What is a resource?
From the official docs,
The Resource is one of the central parts of Sling. Extending from JCR’s everything is Content, Sling assumes everything is a Resource.

Each resource has a resourceType which is used by the Servlet and Script resolver to find the appropriate Servlet or Script to handle the request for the Resource.
This means there can be many servlets in our application with unique resource types. Whenever our application uses that resourceType, that corresponding servlet will be executed.

Code Example
So, without further ado, let’s dive into an example of Sling Servlet which leverages resourceType. Let’s say, we have a TODO component that lists all the TODOs we have in our JCR repository (remember we stored the TODOs from external API in Day 08 - OSGi Components and Services).

Read Full Blog

Day 10 - Sling Servlets (Part II)


Please use this thread to ask the related questions.


Topics help categorize Community content and increase your ability to discover relevant content.

0 Replies