*/
@RequestMapping(value="/module/htmlformentry/htmlForm", method=RequestMethod.GET)
public void showHtmlForm(Model model,
HttpSession httpSession,
@ModelAttribute("htmlForm") HtmlForm htmlForm) {
HtmlForm hf = (HtmlForm) model.asMap().get("htmlForm");
if (hf.getId() == null) {
model.addAttribute("previewHtml", "");
} else {
try {
Patient demo = HtmlFormEntryUtil.getFakePerson();
FormEntrySession fes = new FormEntrySession(demo, hf.getXmlData(), httpSession);
String html = fes.getHtmlToDisplay();
if (fes.getFieldAccessorJavascript() != null) {
html += "<script>" + fes.getFieldAccessorJavascript() + "</script>";
}
model.addAttribute("previewHtml", html);