【问题标题】:Difference between cq include ,sling include and jsp includecq include、sling include和jsp include之间的区别
【发布时间】:2016-07-06 02:35:26
【问题描述】:

sling 和 cq includes 有什么区别,什么时候应该使用它们?我发现两者都解决了相同的目的。

这两者与 jsp include 有何不同

【问题讨论】:

    标签: jsp aem sling


    【解决方案1】:
    1. <sling:include path="layout-link.jsp" />

    这是 Sling JSP 标签库的包含标签。这个标签了解 Sling,也支持 RequestDispatcherOptions。

    1. <cq:include script="layout-link.jsp" />

    此标记是 Sling JSP 标记库包含标记的 Communiqué 特定扩展。 IIRC 除了包含资源渲染之外,它还支持调用脚本。

    在 Communiqué 应用程序中,我建议通常使用 Communiqué 或 Sling 包含标签,因为这可以为您提供更多 Sling 支持。

    如果您对 Sling 扩展功能没有特定要求、计划在 Communiqué 之外使用 JSP(片段)或者如果您想使用阅读器进一步处理生成(导入)的内容,则可以使用 JSTL 导入标签或变量。

    更多详情请见The AEM KB entry on what is the difference between c:import, sling:include, and cq:include?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-06-03
      • 1970-01-01
      • 2010-09-23
      • 1970-01-01
      • 2021-05-28
      相关资源
      最近更新 更多