我如何找出导致某个URL解析为合成资源的原因? [英] How can I find out what is causing a certain URL to be resolved to a synthetic resources?
问题描述
在我的Adobe CQ 5(CQ 5.6)安装中,由于某种原因,有一个URL(http://localhost:4503/services
)正在被解析为合成资源:
On my Adobe CQ 5 (CQ 5.6) installation, for some reason, there's a URL (http://localhost:4503/services
) that is getting resolved to a synthetic resource:
这导致CQ显示以下页面,而不是"404页面未找到"页面:
This is causing CQ to show the following page, rather than a 404 Page Not Found page:
是什么原因导致这种行为?
What is causing this behavior?
推荐答案
您收到Forbidden
错误的原因不是/services
的奇怪类型,而是因为您没有添加任何扩展名(您会得到要求/content/geometrixx
的相同结果).让我们尝试添加一些扩展名:.html
并不真正起作用,但是.infinity.tidy.json
会导致有趣的发现:
You get Forbidden
error not because of the strange type of the /services
, but because you didn't add any extension (you'll get the same result requesting /content/geometrixx
). Let's try to add some extension: .html
doesn't really work, but .infinity.tidy.json
results in interesting discovery:
{
"tagfilter": {
"sling:resourceType": "/services/tagfilter.servlet",
"servletClass": "com.adobe.cq.social.commons.impl.servlets.TagFilterServlet",
"sling:resourceSuperType": "sling/bundle/resource",
"servletName": "com.adobe.cq.social.commons.impl.servlets.TagFilterServlet"
},
"tagfilter.servlet": {
"sling:resourceType": "/services/tagfilter.servlet",
"servletClass": "com.adobe.cq.social.commons.impl.servlets.TagFilterServlet",
"sling:resourceSuperType": "sling/bundle/resource",
"servletName": "com.adobe.cq.social.commons.impl.servlets.TagFilterServlet"
},
...
/services
似乎是虚拟(或者, synthetic )路径,是servlet的父级.实际上,您不能将servlet绑定到任何路径,最受欢迎的选择是/bin
前缀,但是/services
也可以.您可以在 Apache Sling Servlet/脚本解析器和错误处理程序 OSGi配置中找到所有此类路径的列表.
It seems that /services
is a virtual (or, well, synthetic) path, a parent for servlets. In fact, you can't bind servlet to any path, the most popular choice is /bin
prefix, however /services
is possible as well. You'll find a list of all such paths in Apache Sling Servlet/Script Resolver and Error Handler OSGi configuration.
这篇关于我如何找出导致某个URL解析为合成资源的原因?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!