How can I find out what is causing a certain URL to be resolved to a synthetic resources?

浪尽此生 提交于 2019-12-24 07:07:08

问题


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:

This is causing CQ to show the following page, rather than a 404 Page Not Found page:

What is causing this behavior?


回答1:


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"
  },
  ...

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.



来源:https://stackoverflow.com/questions/22834912/how-can-i-find-out-what-is-causing-a-certain-url-to-be-resolved-to-a-synthetic-r

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!