Hi All, I have a sling model and I am using @SlingObject SlingHttpServletReponse reponse to get a reference to the response object
same works fine in author but in publisher the response object is null
Any thoughts on why this might be?
Solved! Go to Solution.
If it works fine in Author - but not in Publisher - this means there is something missing on Publisher that is present in the Author instance.
Thanks SmacDonald. I'm using Resource as the adaptable. From the documentation, I understand that response object may not be available if resource is used as the adaptable. Workaround would be to use @Via to get the response object from request adaptable. And @SlingObject is supposed to be a replacement of @Via so @SlingObject should be able to inject the response object too even if the adaptable is Resource. Am I right in my understanding?