Hi,

On Thu, Nov 13, 2014 at 1:32 AM, Bruce Edge
<[email protected]> wrote:
> ...If I wanted to enable this behavior with a new format identifier (if that’s
> the right term for “tidy”, “infinity”, etc), ...

We call those "selectors".

> would this fit better as a ResourceDecorator or more like a new extension
> of SlingSafeMethodsServlet?...

That sounds like a new servlet that extends SlingSafeMethodsServlet
indeed, registered with a "hal" selector for example, so that
/foo.tidy.infinity.hal.json calls your variant. Would be a useful
contribution for Sling BTW.

That servlet might just use RequestDispatcher.include(...) to insert
the standard Sling JSON rendering in the right place - I haven't tried
that but it's easy to try, and if that doesn't work we could refactor
the JsonRendererServlet [1] to make the rendering part reusable.

-Bertrand

[1] 
https://svn.apache.org/repos/asf/sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/JsonRendererServlet.java

Reply via email to