sightly

Get .model.json as String

六眼飞鱼酱① 提交于 2021-02-08 04:59:24
问题 I wonder if there is an easy way to get a String with the result of a sling content exporter in AEM. In my current usecase I need the content of a component's .model.json output in the component's htl file and sending an additional request is obviously not a good idea. Any hints on how I can get the data? 回答1: After some reading and experimenting, I found a way to do it: Add a dependency to the following package in your pom: <dependency> <groupId>com.fasterxml.jackson.core</groupId>

How to call Sling Model Method with input parameter AEM

半城伤御伤魂 提交于 2020-04-07 09:16:43
问题 I am having a scenario in which i want to call a sling model with input parameter. For this i have a code like this <div data-sly-use.model3="${'com.bhf.aem.sling.models.Test' @ colour='red'}"> </div> But I want to call a method in sling model twice with two different parameters .Is it possible with sling models? Any Help!!! 回答1: From AEM 6.3 there is a new HTL feature that allows to do this. In the data-sly-include and data-sly-resource you can now pass requestAttributes in order to use them