HtmlRendererServlet with ValueMap

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

HtmlRendererServlet with ValueMap

Satya Deep Maheshwari
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
Reply | Threaded
Open this post in threaded view
|

Re: HtmlRendererServlet with ValueMap

Felix Meschberger-3
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 <[hidden email]>:
>
> 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

Reply | Threaded
Open this post in threaded view
|

Re: HtmlRendererServlet with ValueMap

Satya Deep Maheshwari
Thanks Felix. Yes that's what I am doing.

On Tue, Jan 20, 2015 at 12:40 PM, Felix Meschberger <[hidden email]>
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 <[hidden email]
> >:
> >
> > 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
>
>