SlingInternalRequest: A Cleaner Way to Reuse AEM Servlets with Internal API Access | Community
Skip to main content
aanchal-sikka
Community Advisor
Community Advisor
July 8, 2025

SlingInternalRequest: A Cleaner Way to Reuse AEM Servlets with Internal API Access

  • July 8, 2025
  • 2 replies
  • 425 views
AEM Discussions

SlingInternalRequest: A Cleaner Way to Reuse AEM Servlets with Internal API Access by Aanchal Sikka


Overview

When building features in Adobe Experience Manager (AEM), there are times you need to leverage servlet logic that already exists—especially when it interacts with internal AEM APIs not available through public interfaces.

For example, I recently needed to programmatically create Live Copies for assets. AEM doesn’t expose public Java APIs for this directly, but the WCMCommand Servlet performs this exact action behind the scenes.

Instead of reinventing the wheel or making a fragile external HTTP call, I used SlingInternalRequest API to invoke the servlet internally

 

For details, please visit https://techrevel.blog/2025/07/08/slinginternalrequest-a-cleaner-way-to-reuse-aem-servlets-with-internal-api-access/


Q&A

Please use this thread to ask questions relating to this article

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

2 replies

kautuk_sahni
Community Manager
Community Manager
July 14, 2025

Thanks for sharing, Aanchal! This is a clean and effective way to reuse AEM servlets using SlingInternalRequest, especially for internal APIs like WCMCommand. Clear and useful example.

Kautuk Sahni
Uppari_Ramesh
Level 5
July 21, 2025

Nice article, Thank you @aanchal-sikka! I was looking for this kind of feature earlier.