Fix property lazy initialization error.

This commit is contained in:
Paulo Gustavo Veiga 2023-12-04 20:29:19 -08:00
parent 15325672a0
commit 19d083e218
2 changed files with 3 additions and 2 deletions

View File

@ -56,7 +56,7 @@ public class MvcMindmapController {
private MindmapService mindmapService; private MindmapService mindmapService;
@RequestMapping(value = "maps/{id}/print") @RequestMapping(value = "maps/{id}/print")
public String showPrintPage(@PathVariable int id, @NotNull Model model) throws MapCouldNotFoundException, AccessDeniedSecurityException { public String showPrintPage(@PathVariable int id, @NotNull Model model) throws WiseMappingException {
final MindMapBean mindmap = findMindmapBean(id); final MindMapBean mindmap = findMindmapBean(id);
model.addAttribute("principal", Utils.getUser()); model.addAttribute("principal", Utils.getUser());
@ -64,6 +64,7 @@ public class MvcMindmapController {
model.addAttribute("creatorFullName", mindmap.getCreator().getFullName()); model.addAttribute("creatorFullName", mindmap.getCreator().getFullName());
final Locale locale = LocaleContextHolder.getLocale(); final Locale locale = LocaleContextHolder.getLocale();
model.addAttribute("locale", locale.toString().toLowerCase()); model.addAttribute("locale", locale.toString().toLowerCase());
model.addAttribute("properties", mindmap.getProperties());
return "mindmapViewonly"; return "mindmapViewonly";
} }

View File

@ -24,7 +24,7 @@
<script type="text/javascript"> <script type="text/javascript">
var mapId = '${mindmap.id}'; var mapId = '${mindmap.id}';
var historyId = '${hid}'; var historyId = '${hid}';
var userOptions = ${mindmap.properties}; var userOptions = ${properties};
var locale = '${locale}'; var locale = '${locale}';
var isAuth = ${principal != null}; var isAuth = ${principal != null};
</script> </script>