[ 
https://issues.apache.org/jira/browse/SLING-5726?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17453088#comment-17453088
 ] 

Konrad Windszus edited comment on SLING-5726 at 12/3/21, 3:30 PM:
------------------------------------------------------------------

It only affects the two mentioned injectors, as no other injector is calling 
AbstractInjector.getValueMap(). It is IMHO at least partly a bug, because the 
documentation at 
[https://sling.apache.org/documentation/bundles/models.html#available-injectors]
 states (incorrectly) that ResourcePathInjector is applicable to 
"{{{}Resource{}}} or {{SlingHttpServletRequest}} objects" which wasn't the case 
prior to this bugfix.


was (Author: kwin):
It only affects the two mentioned injectors, as no other injector is calling 
AbstractInjector.getValueMap(). It is IMHO at least partly a bug, because the 
documentation at 
[https://sling.apache.org/documentation/bundles/models.html#available-injectors]
 states (incorrectly) that ResourcePathInjector is applicable to 
"{{{}Resource{}}} or {{SlingHttpServletRequest}} objects"

> Allow ValueMapInjector and ResourcePathInjector to act directly on 
> SlingHttpServletRequest
> ------------------------------------------------------------------------------------------
>
>                 Key: SLING-5726
>                 URL: https://issues.apache.org/jira/browse/SLING-5726
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Sling Models Impl 1.2.8
>            Reporter: Konrad Windszus
>            Assignee: Konrad Windszus
>            Priority: Major
>             Fix For: Models Implementation 1.5.0
>
>         Attachments: SLING-5726.patch
>
>
> Currently both injectors only work correctly on objects being adaptable to a 
> {{ValueMap}}. For {{ValueMapInjector}} this is documented but for 
> {{ResourcePathInjector}} it is not 
> (http://sling.apache.org/documentation/bundles/models.html#available-injectors),
>  although for the latter it does only matter if the path is given through a 
> resource property and not in a static way.
> This should be relaxed that both also work with {{SlingHttpServletRequest}} 
> as that always carries the current resource from which the {{ValueMap}} can 
> be easily retrieved.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to