@Override
public void render(GraphNode res, GraphNode context, Map<String, Object> sharedRenderingValues,
CallbackRenderer callbackRenderer, URI renderingSpecification,
String mode, MediaType mediaType,
RequestProperties requestProperties, OutputStream os) throws IOException {
try {
logger.debug("ScalaServerPagesRenderlet rendering");
final char[] scriptBytes = getScriptChars(renderingSpecification);
final Renderlet cs = getCompiledRenderlet(scriptBytes);
cs.render(res, context, sharedRenderingValues, callbackRenderer,
renderingSpecification, mode, mediaType, requestProperties, os);
} catch (MalformedURLException ex) {
throw new WebApplicationException(ex);
} catch (CompileErrorsException ex) {
logger.error("Error compiling "+renderingSpecification+": "+ex.getMessage());
Exception cause = (Exception) ex.getCause();
if (cause != null) {
if (cause instanceof TypeRenderingException) {
throw (TypeRenderingException) cause;
}
throw new RenderingException(cause, renderingSpecification, res, context);
}
throw new RenderingspecificationException(ex.getMessage(), renderingSpecification,
0,0, res, context);
}
}