Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个设计对话框,其中的值存储在 etc/design// 中。但是现在我应该如何在 Sling 模型中读取这些属性?
您可以使用脚本绑定来获取 currentStyle -
@Inject @Source("script-bindings") private Style currentStyle
然后使用 -
currentStyle.get("<name of the text field>",String.class)
您可以注入 aResourceResolverFactory然后获取 a ResourceResolver,然后获取您需要的任何属性。
ResourceResolverFactory
ResourceResolver