On 11 May 2011 10:50, Scott Wilson <[email protected]> wrote:
> Currently In the Controller class there is content-type support, it just 
> requires for each Controller method that returns a representation that you 
> implement a serializer in its respective Helper class. To get the different 
> views you either send a content-type header in the request, or if you can't 
> for some reason you can also add "?format=json" or whatever.
>
> e.g. in the WARP controller:
>
>                switch (format(request)) {
>                        case XML: 
> returnXml(AccessRequestHelper.createXMLAccessRequestDocument(accessRequests),response);break;
>                        case HTML: 
> returnHtml(AccessRequestHelper.createAccessRequestHTMLTable(accessRequests),response);break;
>                        case JSON: 
> returnJson(AccessRequestHelper.createJSON(accessRequests),response);break;
>                }
>
>
> And in the whitelist controller:
>
>                switch (format(request)) {
>                        case XML: 
> returnXml(WhitelistHelper.createXMLDocument(entries),response);break;
>                        case JSON: 
> returnHtml(WhitelistHelper.createJSON(entries),response);break;
>                        case HTML: 
> returnHtml(WhitelistHelper.createHTML(entries),response);break;
>                }
>
> (Going with Ross's proposal we'd remove the HTML option, or wire it to return 
> XML with an XSLT)

That clarifies that question if XLST processing will be internal

Steve

Reply via email to