QuestionQ46

No official topic/domain breakdown was publicly listed on the Adobe certification page or prep guide page I could access for AD0-E137

A developer is troubleshooting an issue in which a Sling Model is not correctly adapting to the resource. While investigating, the developer finds the following Sling Model code:

@Model(adaptables = Resource.class)

public class MyCustomModel {

Question Image

What is the cause of the issue?

Explanation

Sling Models populate fields through declared injection points. A property field that is expected to receive a value from the adaptable resource must be annotated for injection, such as with @Inject or the more specific @ValueMapValue; an unannotated title field is not automatically injected. Resource is a valid adaptable type, and @PostConstruct methods may be protected.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!