UserResourceRenderer2 producer = (UserResourceRenderer2) renderer;
producer.encodeToHead(context, component);
} else if (renderer instanceof UserResourceRenderer) {
context.setResponseWriter(userWriter);
UserResourceRenderer producer = (UserResourceRenderer) renderer;
encodeResources(context, resourceBuilder.getScriptRenderer(), producer.getHeaderScripts(context,
component));
encodeResources(context, resourceBuilder.getStyleRenderer(), producer.getHeaderStyles(context,
component));
}
} finally {
context.setResponseWriter(oldResponseWriter);
}