QuestionQ33

VerifiedGiven a scenario, identify how to implement Sling Models and HTL

An AEM Developer receives a requirement for Sling Models in a human-readable YAML format. A custom application must be built. The dependency is shown below:

Question Image

After implementing ModelExporter, which method should be used to satisfy this requirement?

Explanation

A custom ModelExporter can serialize Sling Models to YAML using Jackson’s YAML dataformat. The .yaml extension must be mapped to its MIME type through the Apache Sling MIME Type Service, which Sling uses to determine a response content type from the request extension. OSGi models, the Servlet/Script Resolver and Error Handler, and the Referrer Filter do not provide this Sling Model export and MIME-mapping behavior.

Learn more

Community Discussion

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