auraInit.put("deftype", def.getDescriptor().getDefType());
auraInit.put("host", contextPath);
StringBuilder contextWriter = new StringBuilder();
Aura.getSerializationService().write(context, null, AuraContext.class, contextWriter, "HTML");
auraInit.put("context", new Literal(contextWriter.toString()));
attributes.put("auraInit", Json.serialize(auraInit));
}
Component template = instanceService.getInstance(templateDef.getDescriptor(), attributes);
renderingService.render(template, out);