问题
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