/** * Overridden to get use apply the XLST transformation on the content. * * @throws TransformerException */ public void appendToResponse(WOResponse response, WOContext context) { start = System.currentTimeMillis(); current = start; if (isEnabled()) { WOResponse newResponse = new WOResponse(); newResponse.setContentEncoding(response.contentEncoding()); super.appendToResponse(newResponse, context); if (log.isDebugEnabled()) { String contentString = newResponse.contentString(); log.debug("Converting content string:\n" + contentString); } try { NSData data = transform(transformer(), newResponse.content()); if (hasBinding("data") && canSetValueForBinding("data")) { setValueForBinding(data, "data"); } if (hasBinding("stream") && canSetValueForBinding("stream")) { setValueForBinding(data.stream(), "stream"); } response.appendContentData(data); } catch (TransformerException e) { throw NSForwardException._runtimeExceptionForThrowable(e); } } else { super.appendToResponse(response, context); } log.debug("Total: " + (System.currentTimeMillis() - start)); start = System.currentTimeMillis(); }