Map<String, Object> inputs = dto.getInputsAsMap();
Renderer renderer = getRenderer(language);
inputs.put(Renderer.BASE_CONTEXT_PATH, context.getContextPath());
Locale locale = request.getLocale();
inputs.put(Renderer.BASE_LOCALE, locale == null ? "default" : locale.getDisplayName(locale));
Object html = renderer.render(url, inputs);
String htmlUrl = createHtmlTemplate(html, language, context);
return Response.ok(htmlUrl, MediaType.TEXT_PLAIN).build();
} catch (FormEncodingException e) {
return error("Problem encoding form preview", e);
} catch (TranslatorException e) {