How to call Sling Model Method with input parameter AEM

前端 未结 2 851
北荒
北荒 2021-01-27 09:32

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

2条回答
  •  甜味超标
    2021-01-27 09:52

    By design of the HTL/Sightly language, sending parameters is only possible for data-sly-use (use objects initialization) and data-sly-call (template calls). The reason for this is to separate business logic from the view.

    As mentioned by @tomasz-szymulewski, since https://issues.apache.org/jira/browse/SLING-5812, there is support for passing request attributes on resource/script inclusion in the Sling/AEM implementation.

提交回复
热议问题