You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by connuser1 connuser1 <co...@gmail.com> on 2015/01/20 08:03:34 UTC
HtmlRendererServlet with ValueMap
Hi
I am relying on the default get servlet for rendering my custom (non-JCR)
resource. I see that with the .html extension, the HtmlRendererServlet
comes into play and it tries to adapt the resource to either of Map, String
or String[]. Is there a specific reason for it to not try to adapt to
ValueMap as well? I ask this because I find resource being adapted to value
map quite frequently and if the HtmlRendererServlet could do that as well,
a custom resource's adaptation to value map would just suffice.
Thanks
Re: HtmlRendererServlet with ValueMap
Posted by connuser1 connuser1 <co...@gmail.com>.
Thanks Felix. Yes that's what I am doing.
On Tue, Jan 20, 2015 at 12:40 PM, Felix Meschberger <fm...@adobe.com>
wrote:
> Hi
>
> Since ValueMap extends Map, you should be perfectly fine: just accept Map
> as well and return your ValueMap. Done. :-)
>
> Regards
> Felix
>
> > Am 20.01.2015 um 08:03 schrieb connuser1 connuser1 <connuser1@gmail.com
> >:
> >
> > Hi
> >
> > I am relying on the default get servlet for rendering my custom (non-JCR)
> > resource. I see that with the .html extension, the HtmlRendererServlet
> > comes into play and it tries to adapt the resource to either of Map,
> String
> > or String[]. Is there a specific reason for it to not try to adapt to
> > ValueMap as well? I ask this because I find resource being adapted to
> value
> > map quite frequently and if the HtmlRendererServlet could do that as
> well,
> > a custom resource's adaptation to value map would just suffice.
> >
> > Thanks
>
>
Re: HtmlRendererServlet with ValueMap
Posted by Felix Meschberger <fm...@adobe.com>.
Hi
Since ValueMap extends Map, you should be perfectly fine: just accept Map as well and return your ValueMap. Done. :-)
Regards
Felix
> Am 20.01.2015 um 08:03 schrieb connuser1 connuser1 <co...@gmail.com>:
>
> Hi
>
> I am relying on the default get servlet for rendering my custom (non-JCR)
> resource. I see that with the .html extension, the HtmlRendererServlet
> comes into play and it tries to adapt the resource to either of Map, String
> or String[]. Is there a specific reason for it to not try to adapt to
> ValueMap as well? I ask this because I find resource being adapted to value
> map quite frequently and if the HtmlRendererServlet could do that as well,
> a custom resource's adaptation to value map would just suffice.
>
> Thanks