if(!baseRef.endsWith("/")) {
baseRef += "/";
}
Configuration tmpltCfg = getTemplateConfiguration();
ViewModel viewModel = new ViewModel();
viewModel.setFlashes(Flash.getFlashes(getRequest()));
viewModel.put("baseRef",baseRef);
viewModel.put("staticRef", getStaticRef(""));
viewModel.put("baseResourceRef",getRequest().getRootRef().toString()+"/engine/static/");
viewModel.put("model", makeDataModel());
viewModel.put("selectedEngine", chosenEngine);
try {
Template template = tmpltCfg.getTemplate("Script.ftl");
template.process(viewModel, writer);
writer.flush();