You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2014/03/27 10:54:57 UTC
svn commit: r1582238 - in
/sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl:
ResourceResolverImpl.java tree/ResourceProviderEntry.java
Author: cziegeler
Date: Thu Mar 27 09:54:57 2014
New Revision: 1582238
URL: http://svn.apache.org/r1582238
Log:
SLING-3482 : Synthetic resources should lead to a 404
Modified:
sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java
sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/tree/ResourceProviderEntry.java
Modified: sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java?rev=1582238&r1=1582237&r2=1582238&view=diff
==============================================================================
--- sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java (original)
+++ sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java Thu Mar 27 09:54:57 2014
@@ -912,14 +912,14 @@ public class ResourceResolverImpl extend
if (childName.equals(alias)) {
logger.debug("getChildInternal: Found Resource {} with alias {} to use", child, childName);
final Resource aliasedChild = getResourceInternal( ResourceUtil.normalize(child.getPath()) );
- return aliasedChild;
+ return aliasedChild;
}
}
}
}
}
}
-
+
// no match for the childName found
logger.debug("getChildInternal: Resource {} has no child {}", parent, childName);
return null;
Modified: sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/tree/ResourceProviderEntry.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/tree/ResourceProviderEntry.java?rev=1582238&r1=1582237&r2=1582238&view=diff
==============================================================================
--- sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/tree/ResourceProviderEntry.java (original)
+++ sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/tree/ResourceProviderEntry.java Thu Mar 27 09:54:57 2014
@@ -35,7 +35,6 @@ import org.apache.sling.api.resource.Res
import org.apache.sling.api.resource.ResourceProvider;
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.api.resource.ResourceUtil;
-import org.apache.sling.api.resource.SyntheticResource;
import org.apache.sling.resourceresolver.impl.helper.ResourceResolverContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -359,12 +358,19 @@ public class ResourceProviderEntry imple
// resource Provider: libs/sling/servlet/default/GET.servlet
// list will match libs, sling, servlet, default
// and there will be no resource provider at the end
- if (entries.size() > 0 && entries.size() == elements.length) {
- if (entries.get(entries.size() - 1).getResourceProviders().length == 0) {
- logger.debug("Resolved Synthetic {}", fullPath);
- return new SyntheticResource(resourceResolver, fullPath, ResourceProvider.RESOURCE_TYPE_SYNTHETIC);
- }
- }
+ // SLING-3482 : The code below does not seem to be required anymore:
+ // if a servlet is mounted by the servlet provider at
+ // libs/sling/servlet/default/GET.servlet
+ // then the entry for libs/sling/servlet/default will have an entry anyway
+ // and if scripts are stored at that location, the entry
+ // will exist as well.
+
+// if (entries.size() > 0 && entries.size() == elements.length) {
+// if (entries.get(entries.size() - 1).getResourceProviders().length == 0) {
+// logger.debug("Resolved Synthetic {}", fullPath);
+// return new SyntheticResource(resourceResolver, fullPath, ResourceProvider.RESOURCE_TYPE_SYNTHETIC);
+// }
+// }
logger.debug("Resource null {} ", fullPath);
return null;