8/16/2020

AEM-Servlets with OSGi DS latest annotations

 AEM-Servlets

With new OSGi Declarative Services

Prerequisites:

  • bnd 4.0+ via
    • bnd-maven-plugin 4.0+ or
    • maven-bundle-plugin 4.0+
  • DS 1.3 (AEM 6.1+)
  • Maven Dependency

<dependency>
<groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.servlets.annotations</artifactId> <version>1.1.0</version>
</dependency>

@Component(service=Servlet.class)
@SlingServletResourceTypes( resourceTypes="/apps/my/type", selectors= {"hello"})
public class ResourceTypeBoundServletWithSelectors extends SlingSafeMethodsServlet 
{...
}



No comments:

Post a Comment