How Do You Base a Servlet on Resource Type?


One design pattern in Apache Sling (and Adobe Experience Manager) calls for making servlets based on resource types and not paths. See AEM Design Pattern: Base Servlets on Resource Types and A Brief Summary of Servlets in Apache Sling for more information about this.

Well then, how do you base a servlet on resource type vs. path? At Stackoverflow, a user asked this question and got the answer from Sharath Madappa. The @Slingservlet annotation use is described in the Sling documentation, Servlets and Scripts. The Adobe blog, Adobe@Adobe, documents the how to configure Sling servlets as well: CQ Tips and Tricks #1 – How to define a SlingServlet.

Update 23 April 2015

See Adobe CQ Help | Binding Adobe Experience Manager Servlets to ResourceTypes

About The Author

Deke departed Southern Alabama as a young man, leaving the humidity and fire ants behind. The fire ants are catching up with him. He works for Adobe. Despite that, his opinions expressed on this site are his own and should never, ever, be attributed or blamed on Adobe. Ask him what he thinks of chiggars sometime. Home Page | GitHub | Adobe Blog | Twitter | LinkedIn