Category: Sling Servlet

Handling Http Requests, HttpClient, in AEM

When integrating with external services or APIs from Adobe Experience Manager (AEM), utilizing the HttpClient for outbound HTTP requests is a common requirement. It’s crucial to handle these connections efficiently, securely, and in a way that is compatible with AEM’s architecture to ensure optimal performance and maintainability of your code. AEM provides a specialized factory, […]

Benefits of SlingSafeMethodsServlet with Code Examples

A robust security strategy is pivotal to safeguarding applications. As an AEM developer, we must really understand the SlingSafeMethodsServlet, an invaluable feature within the Apache Sling framework. This article explores the core concepts, practical benefits, and the heightened security it brings to servlet development. The org.apache.sling.api.servlets.SlingSafeMethodsServlet is an extension of the trusted HttpServlet in Apache […]

AEM Convert Excel to JSON Simple Servlet Example

In this article, I present a straightforward yet powerful solution that demonstrates how to seamlessly convert Excel data into JSON format using Adobe Experience Manager (AEM). By implementing a custom servlet, I will illustrate the process of converting an Excel sheet named ‘example.xlsx’ into structured JSON data; it can be downloaded below for you following […]

JCR SQL2 ISDESCENDANTNODE Multiple Paths Example

While working with the JCR SQL2 Queries, you may encounter scenarios where content is distributed across various branches of the repository. Querying these branches efficiently is key to implement features to capture requirements. In this article, we will focus o how to collect and query for distributed across various branches of the repository. Using the […]

Retrieving the Current Page in an AEM Servlet via ResourceType

In the context of “Retrieving the Current Page in an AEM Servlet via ResourceType”, it is great to understand how this is done. This guide provides a simplified walkthrough on how you can adeptly achieve this. In the code example, we will associating the servlet with a resourceType. 123456789101112131415161718192021222324252627282930313233343536373839package com.example.aem.servlets; import org.apache.sling.api.SlingHttpServletRequest; import org.apache.sling.api.SlingHttpServletResponse; import […]

How to access Design Dialogue Properties in Sling Model

Design Dialogs are especially useful for creating components that need to be easily configurable through editable template and policies without directly editing the underlying code. They enable a clear separation between content and presentation, allowing content authors to make changes without needing technical expertise. Design Dialogs are defined using the AEM Touch UI Dialog, which […]

How to use AEM JCR SQL2 query strings to query for nodes in Java Content Repository

JCR-SQL2 (Java Content Repository – Structured Query Language 2) is domain specific language used to query JCR nodes held in the JCR repository. The syntax for JCR-SQL2 is fairly similar to SQL, so if you have some experience with SQL, this tutorial will be a walk in the park for you. The best way to […]

Back To Top