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 toleverage servlet logic that already exists—especially when it interacts with internal AEM APIs not available through public interfaces.
For example, I recently needed toprogrammatically create Live Copies for assets. AEM doesn’t expose public Java APIs for this directly, but theWCMCommand Servletperforms 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 servletinternally
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.