- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在查看 sling 如何根据 url 调用脚本。在选择器的情况下,它似乎工作正常,但如果我不使用选择器,我会感到困惑:
我有一个页面 /content/AEMProject/English/test.html
有 resourceType AEMProject/components/page/basepage
资源基页有 4 个脚本文件:basepage.html.jsp、basepage.jsp、html.jsp、GET.jsp
。我红了 Sling Best Match 的概念。所以我有两个奇怪的案例。
1) 我的 basepage.html.jsp
正在执行,因为我认为它是最佳匹配。如果我删除此文件 html.jsp
执行,但我认为 basepage.jsp
是第二好的情况。
2) 如果我删除 basepage.html.jsp 、 basepage.jsp 、 html.jsp
文件,我的 GET.jsp
不会呈现。
我在这里考虑底页作为选择器或 IS 不是。
谢谢
最佳答案
引自sling docs脚本路径优先级规则定义如下:
- The more request selectors are matched, the better.
(请注意,不会选择具有多个选择器的脚本,即,如果您有脚本 x.y.jsp,其中 x 和 y 是您的选择器,sling 会忽略它。但它仍会选择脚本 y.jsp
,存在于文件夹 x
中,即,如果请求是针对 test.x.y.html,则
-basepage
|_x
|_y.jsp (selected)
|_x.y.jsp (ignored)
|_x.jsp (selected in case x/y.jsp is not present. The script containing the first selector is chosen in such cases.)
A script including the request extension matches better than one without a request extension (for html only)
A script found earlier matches better than a script found later in the processing order. This means, that script closer to the original resource type in the resource type hierarchy is considered earlier.
那么现在回答你的问题,
您的 html.jsp 将始终优先于您的 component.jsp,而不是相反。
您的 GET.jsp 应该在最坏的情况下执行,即当没有其他文件存在时,除非您从其他组件继承了它。
关于aem - Sling 解析脚本调用顺序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27213555/
我使用的是 Adobe Experience Manager (AEM) 6.3。在基本结构中,组件文件夹包含内容文件夹和结构文件夹。在我们放置组件的两个文件夹中。这两个文件夹有什么区别? 最佳答
Sling 中选择器有什么用? http://www.resourcePath .选择器.扩展名 我看过网上关于选择器使用的文档: 一些文档说它用于缓存页面的响应,而使用查询参数时无法做到这一点。 虽
如何在 AEMsightly 中仅在预览/ Release模式下删除装饰标签? 我看过问题和答案:AEM/CQ: Conditional CSS class on decoration tag 这会删
我们需要将特定版本的页面保留一段时间,比如说一年。 如果我们使用版本管理器并提供“Max Version Age”和“Max Number Versions”,它将保留该数量的最新 x 个版本时间。
我需要在我正在配置的新实例中安装大型软件包。我正在为此使用包管理器,但安装需要很长时间。还有其他方法可以做到吗?此外,如果我可以获得有关存储 DAM 包的物理位置的信息,那将会很有帮助。 (例如:有什
这个问题在这里已经有了答案: How to use/understand AEM Sling Resource Merger, override and Overlay concepts (1 个回
我正在通过一些在线教程来学习 AEM。根据教程,创建组件时,需要在 Allowed Parents 或 Allowed Children 中输入一些值。但是,我在窗口中看不到这样的选项。当我尝试创建组
扩展组件、覆盖组件和覆盖组件有什么区别。有人可以从开发者的角度解释一下吗 最佳答案 延伸和叠加 是一样的。这只是一个术语问题。扩展和覆盖涉及将组件从/libs/(或其他基础库)复制到/apps 节点并
Adobe AEM(以前称为 Adobe CQ)中的客户端库 (ClientLib) 功能可以轻松地按类别包含客户端库,并且每个库都可以通过依赖项引入其他库。然而,关于“主题”的文档有点薄。 此
如何从浏览器查看发布者日志? 我尝试使用“http://localhost:4503/bin/crxde/logs?tail=1000”。但我没有得到日志。有什么方法可以启用它吗? 最佳答案 使用这个
请概述一下什么是 AEM 中的组件、页面、页面组件和模板。他们之间有什么关系。请尽可能举例说明。 建议任何网站作为初学者开始。 最佳答案 您有点混淆了技术和非技术术语。所以我尝试用两种方式来解释它:从
我正在尝试在列表组件的对话框上启用子编辑器,以允许用户将自定义组件添加到其中,例如来自核心的轮播组件。 我使用 AEM 6.5,并且 sling:resourceSuperType 是来自核心的列表。
使用 crx 包管理器在 AEM 中构建包时抛出错误“包构建未定义”。但是当我在 etc/packages/mypackages 下检查时,包被创建了。即使错误日志中没有错误或异常。我该如何解决这个问
在AEM 6.5的编辑模式下,如果我点击一个组件,会弹出上面的工具栏。除了通过在 CRXDE 上创建 cq:dialog 节点来添加对话框( Spanner 按钮)之外,您可以在工具栏上创建自定义按钮
在阅读在线 AEM 文档时,我了解到如何在 Debug模式下运行 AEM。 但是如何在远程 AEM 服务器上进行调试? 最佳答案 要使用远程调试,您必须使用此 JVM 参数启动 CQ5:-agentl
假设您有一个页面结构,称为: /content/site/en_us/foo/bar 您需要将 foo 页面从另一个环境移动到这个环境,但我们不想包含 bar 页面或任何其他子页面。 如果我定义一个包
我有一个服务于多个站点的 AEM 实例。一个站点正在使用一个组件。我想在另一个网站上使用这个组件。我不想将组件文件复制并粘贴到第二个站点并像那样拆分代码库。有谁知道在另一个站点上使用此组件的方法吗?
默认情况下,所有 GET 请求首先转到 DefaultGetServlet。基于扩展,它将请求委托(delegate)给渲染器。现在,如果请求 URI 中没有扩展名,为什么 AEM 会发送 403 (
我使用 ACS.CQ 库中的 xtype 'multifieldpanel' 进行 'multifield configuration'。而且我无法在我的对话框中设置“pathfield”的大小。我需
我正在使用 AccountManager API 来创建用户。当我不在注册表中使用个人资料图片并且用户注册时它工作得很好但是一旦我使用个人资料图片,我会收到以下错误: Caused by: javax
我是一名优秀的程序员,十分优秀!