Author: kwin Date: Thu May 21 08:48:44 2015 New Revision: 1680764 URL: http://svn.apache.org/r1680764 Log: more information about sling-objects injector limitations (resource injection only works with injector-specific annotation)
Modified: sling/site/trunk/content/documentation/bundles/models.mdtext Modified: sling/site/trunk/content/documentation/bundles/models.mdtext URL: http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/bundles/models.mdtext?rev=1680764&r1=1680763&r2=1680764&view=diff ============================================================================== --- sling/site/trunk/content/documentation/bundles/models.mdtext (original) +++ sling/site/trunk/content/documentation/bundles/models.mdtext Thu May 21 08:48:44 2015 @@ -369,7 +369,7 @@ Request Attributes | `request-attributes OSGi Services | `osgi-services` | 5000 | 1.0.0 | Lookup services based on class name | Any object | yes | yes | Parameterized `List` and `Collection` injection points are injected by getting an array of the services and creating an unmodifiable `List` from the array. Resource Path | `resource-path` | 2500 | 1.1.0 | Injects a resource by its path. | `Resource` or `SlingHttpServletRequest` objects | yes | none | none Self | `self` | `Integer.MAX_VALUE` | 1.1.0 | Injects the adaptable object itself (if the class of the field matches or is a supertype). If the @Self annotation is present it is tried to adapt the adaptable to the field type. | Any object | yes | none | none -Sling Object | `sling-object` | `Integer.MAX_VALUE` | 1.1.0 | Injects commonly used sling objects if the field matches with the class: request, response, resource resolver, current resource, SlingScriptHelper. This works only if the adaptable can get the according information, i.e. all objects are available via `SlingHttpServletRequest` while `ResourceResolver` can only resolve the `ResourceResolver` object and nothing else. A discussion around this limitation and a potential solution can be found at the [sling-dev mailing list](http://apache-sling.73963.n3.nabble.com/RTC-ThreadLocal-for-getting-current-request-in-sling-td4042387.html). | `Resource`, `ResourceResolver` or `SlingHttpServletRequest` objects (not all objects can be resolved by all adaptables) | yes | none | none +Sling Object | `sling-object` | `Integer.MAX_VALUE` | 1.1.0 | Injects commonly used sling objects if the field matches with the class: request, response, resource resolver, current resource, SlingScriptHelper. This works only if the adaptable can get the according information, i.e. all objects are available via `SlingHttpServletRequest` while `ResourceResolver` can only resolve the `ResourceResolver` object and nothing else. A discussion around this limitation can be found at [SLING-4083](https://issues.apache.org/jira/browse/SLING-4083). Also `Resource`s can only be injected if the according injector-specific annotation is used (`@SlingObject`). | `Resource`, `ResourceResolver` or `SlingHttpServletRequest` objects (not all objects can be resolved by all adaptables). | yes | none | none # Injector-specific Annotations (Since Sling Models Impl 1.0.6)