AEM Sling Model injection and annotation | AEM Community Blog Seeding | Community
Skip to main content
kautuk_sahni
Community Manager
Community Manager
February 1, 2022

AEM Sling Model injection and annotation | AEM Community Blog Seeding

  • February 1, 2022
  • 0 replies
  • 486 views

BlogImage.jpg

AEM Sling Model injection and annotation by Rashidjorvee

Abstract

In this article, we will understand what all are the ways to reading authored values of AEM component using sling model in AEM

Using ValueMapValue annotation of package org.apache.sling.models.annotations.injectorspecific
@ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL)
private String classStartDateLabel;

Using Inject annotation of package javax.inject

@Inject
@Via("resource")
@Optional
private String classStartDateLabel;


Getter method for this injection

public String getClassStartDateLabel() {
return classStartDateLabel;
}

Read Full Blog

AEM Sling Model injection and annotation

Q&A

Please use this thread to ask the related questions.

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