Menu

AEM Sling Model injection and annotation

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;
}

4 comments:

  1. Astrologer Gautam is the best Indian astrologer in the USA. He is an Indian spiritual healer in the USA offering astrology services like a psychic reading, palm reading, and other services. Call now & avail best astrology services the USA.

    Top Astrologer in USA

    ReplyDelete
  2. Our Top Indian Astrologer in New York pandit rudra ji has worked out fully fledged services interface for refined astrology services. Indian Astrologer in New york

    ReplyDelete
  3. you need to consult Top Astrologer in Texas,Master RamDial Ji because he is the one who can solve this husband and wife problem with his effective astrological solutions. Famous Indian Astrologer in Texas

    ReplyDelete
  4. Interesting read You can find similar ideas on Astrologer in USA at Famous Astrologer in Texas.

    ReplyDelete