Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
Sling Models Impl 1.2.2
-
None
-
None
Description
In a sling model, when injecting resources from the resourcePath injector, if you declare the injected field as an array, the injection will fail.
Injection works fine if you declare the field as a list.
to verify.
Have a resource which holds a property with a path to other resource.
Have the following injection:
@ResourcePath(path = "/content/test/node")
private Resource[] pathProperty;
I get the following:
org.apache.sling.models.factory.ModelClassException: Could not adapt from class org.apache.sling.jcr.resource.internal.helper.jcr.JcrNodeResource to class [Lorg.apache.sling.api.resource.Resource;