Aem 如何在吊索模型中获取设计对话框属性?

Aem 如何在吊索模型中获取设计对话框属性?,aem,sling-models,Aem,Sling Models,我有一个设计对话框,其中的值存储在etc/design/。但是现在我应该如何在Sling模型中读取这些属性呢?您可以使用脚本绑定来获取currentStyle- @Inject @Source("script-bindings") private Style currentStyle 然后使用- currentStyle.get("<name of the text field>",String.class) currentStyle.get(“,String.class”) 您

我有一个设计对话框,其中的值存储在etc/design/。但是现在我应该如何在Sling模型中读取这些属性呢?

您可以使用脚本绑定来获取currentStyle-

@Inject @Source("script-bindings")
private Style currentStyle
然后使用-

currentStyle.get("<name of the text field>",String.class)
currentStyle.get(“,String.class”)

您可以插入一个
ResourceResolver Factory
,然后获取一个
ResourceResolver
,然后获取所需的任何属性