You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Konrad Windszus <ko...@gmx.de> on 2017/06/13 14:20:11 UTC
Resource Type Inheritance fully supported for the Sling Servlet
Resolver?
Hi,
Currently if a servlet is registered for a specific resource type, e.g. like the one from https://github.com/Adobe-Marketing-Cloud/aem-core-wcm-components/blob/be656c09ea43ea80b37e0727399aa48de3e43c8a/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/servlets/AdaptiveImageServlet.java it is correctly resolved for a resource with a resource type "componenta" directly having "core/wcm/components/image" as resource super type. But as soon as an additional inheritance level comes into play, e.g. "componenta" deriving from "core/wcm/components/image" and "componentb" deriving from "componenta" the servlet is no longer being resolved for resources having the resource type "componentb" (and instead a 404 is returned, because no other servlet/script for the according selector is registered). Is that a known limitation of the Servlet Resolver?
Thanks,
Konrad
Re: Resource Type Inheritance fully supported for the Sling Servlet
Resolver?
Posted by Konrad Windszus <ko...@gmx.de>.
Ok, forget about this issue here. Actually the Sling Servlet Resolver can deal fine even with transitive resource super types. In my case the issue was within the https://github.com/Adobe-Marketing-Cloud/aem-core-wcm-components/blob/be656c09ea43ea80b37e0727399aa48de3e43c8a/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/servlets/AdaptiveImageServlet.java which was throwing a 404.
> On 13. Jun 2017, at 16:51, Carsten Ziegeler <cz...@apache.org> wrote:
>
> Konrad Windszus wrote
>> "Deriving" in this context means: having a sling:resourceSuperType set.
>> So in my example "componenta" has sling:resourceSuperType set to "core/wcm/components/image/v1/image" and "componentb" has sling:resourceSuperType set to "componenta".
>>
> Got it, thanks - I think that should work...has componenta a different
> resource type than componenta? (not sure if this makes a difference though)
>
> Regards
> Carsten
>
>>> On 13. Jun 2017, at 16:24, Carsten Ziegeler <cz...@apache.org> wrote:
>>>
>>> Konrad Windszus wrote
>>>> Hi,
>>>> Currently if a servlet is registered for a specific resource type, e.g. like the one from https://github.com/Adobe-Marketing-Cloud/aem-core-wcm-components/blob/be656c09ea43ea80b37e0727399aa48de3e43c8a/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/servlets/AdaptiveImageServlet.java it is correctly resolved for a resource with a resource type "componenta" directly having "core/wcm/components/image" as resource super type. But as soon as an additional inheritance level comes into play, e.g. "componenta" deriving from "core/wcm/components/image" and "componentb" deriving from "componenta" the servlet is no longer being resolved for resources having the resource type "componentb" (and instead a 404 is returned, because no other servlet/script for the according selector is registered). Is that a known limitation of the Servlet Resolver?
>>>
>>> I'm not quiet sure what you mean with "deriving"?
>>>
>>> Regards
>>> Carsten
>>>
>>>> Thanks,
>>>> Konrad
>>>>
>>>
>>>
>>>
>>>
>>> --
>>> Carsten Ziegeler
>>> Adobe Research Switzerland
>>> cziegeler@apache.org
>>
>>
>
>
>
>
> --
> Carsten Ziegeler
> Adobe Research Switzerland
> cziegeler@apache.org
Re: Resource Type Inheritance fully supported for the Sling Servlet
Resolver?
Posted by Carsten Ziegeler <cz...@apache.org>.
Konrad Windszus wrote
> "Deriving" in this context means: having a sling:resourceSuperType set.
> So in my example "componenta" has sling:resourceSuperType set to "core/wcm/components/image/v1/image" and "componentb" has sling:resourceSuperType set to "componenta".
>
Got it, thanks - I think that should work...has componenta a different
resource type than componenta? (not sure if this makes a difference though)
Regards
Carsten
>> On 13. Jun 2017, at 16:24, Carsten Ziegeler <cz...@apache.org> wrote:
>>
>> Konrad Windszus wrote
>>> Hi,
>>> Currently if a servlet is registered for a specific resource type, e.g. like the one from https://github.com/Adobe-Marketing-Cloud/aem-core-wcm-components/blob/be656c09ea43ea80b37e0727399aa48de3e43c8a/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/servlets/AdaptiveImageServlet.java it is correctly resolved for a resource with a resource type "componenta" directly having "core/wcm/components/image" as resource super type. But as soon as an additional inheritance level comes into play, e.g. "componenta" deriving from "core/wcm/components/image" and "componentb" deriving from "componenta" the servlet is no longer being resolved for resources having the resource type "componentb" (and instead a 404 is returned, because no other servlet/script for the according selector is registered). Is that a known limitation of the Servlet Resolver?
>>
>> I'm not quiet sure what you mean with "deriving"?
>>
>> Regards
>> Carsten
>>
>>> Thanks,
>>> Konrad
>>>
>>
>>
>>
>>
>> --
>> Carsten Ziegeler
>> Adobe Research Switzerland
>> cziegeler@apache.org
>
>
--
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org
Re: Resource Type Inheritance fully supported for the Sling Servlet
Resolver?
Posted by Konrad Windszus <ko...@gmx.de>.
"Deriving" in this context means: having a sling:resourceSuperType set.
So in my example "componenta" has sling:resourceSuperType set to "core/wcm/components/image/v1/image" and "componentb" has sling:resourceSuperType set to "componenta".
> On 13. Jun 2017, at 16:24, Carsten Ziegeler <cz...@apache.org> wrote:
>
> Konrad Windszus wrote
>> Hi,
>> Currently if a servlet is registered for a specific resource type, e.g. like the one from https://github.com/Adobe-Marketing-Cloud/aem-core-wcm-components/blob/be656c09ea43ea80b37e0727399aa48de3e43c8a/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/servlets/AdaptiveImageServlet.java it is correctly resolved for a resource with a resource type "componenta" directly having "core/wcm/components/image" as resource super type. But as soon as an additional inheritance level comes into play, e.g. "componenta" deriving from "core/wcm/components/image" and "componentb" deriving from "componenta" the servlet is no longer being resolved for resources having the resource type "componentb" (and instead a 404 is returned, because no other servlet/script for the according selector is registered). Is that a known limitation of the Servlet Resolver?
>
> I'm not quiet sure what you mean with "deriving"?
>
> Regards
> Carsten
>
>> Thanks,
>> Konrad
>>
>
>
>
>
> --
> Carsten Ziegeler
> Adobe Research Switzerland
> cziegeler@apache.org
Re: Resource Type Inheritance fully supported for the Sling Servlet
Resolver?
Posted by Carsten Ziegeler <cz...@apache.org>.
Konrad Windszus wrote
> Hi,
> Currently if a servlet is registered for a specific resource type, e.g. like the one from https://github.com/Adobe-Marketing-Cloud/aem-core-wcm-components/blob/be656c09ea43ea80b37e0727399aa48de3e43c8a/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/servlets/AdaptiveImageServlet.java it is correctly resolved for a resource with a resource type "componenta" directly having "core/wcm/components/image" as resource super type. But as soon as an additional inheritance level comes into play, e.g. "componenta" deriving from "core/wcm/components/image" and "componentb" deriving from "componenta" the servlet is no longer being resolved for resources having the resource type "componentb" (and instead a 404 is returned, because no other servlet/script for the according selector is registered). Is that a known limitation of the Servlet Resolver?
I'm not quiet sure what you mean with "deriving"?
Regards
Carsten
> Thanks,
> Konrad
>
--
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org