On Wed, Jun 18, 2008 at 3:52 PM, Alexander Klimetschek <[EMAIL PROTECTED]> wrote:
>> ...Is one use case to >> replace the json renderer completely? Or do you want to use a different json >> renderer depending on the path or the resource type? > > I am talking about all default servlets, including the POST servlet. > Here you might want to handle certain properties differently... I agree that replacing parts of the behavior of the standard GET and POST servlets can be useful, but I'm not sure if this can be fully generalized without making things too complex. I have two use cases in mind where this would be useful: 1) Generating different flavors of JSON output, probably based on selectors 2) Allowing scripts to reuse part of the POST servlet functionality, while customizing part of the POST request processing. I think 1) is fairly easy to solve by making the JsonRendererServlet more expandable, maybe simply factoring out the instantiation of the JsonItemWriter so that people can provide custom variants, by registering servlets that extend JsonRendererServlet. I think this "standard rendering customization" only makes sense for the JSON format currently, so no need for a generalized framework. Solving 2) looks like a different problem, where the SlingPostServlet functionality might need to be broken down in smaller services and components that scripts can reuse in a modular way. I don't see other use cases for customizing our standard servlets at the moment, so I feel the above two cases can be handled "locally" without creating a generalized (and possibly complex) customization framework. -Bertrand
