thymeleaf:访问list,map等

1.map

在后端放入一个map

Map<String, String> mapDict = serviceBaseDict.selectMap(ConstantDictType.SYSINFO);
model.addAttribute("mapDict", mapDict);

在页面中访问这个map

<b th:value="${mapDict['sysInfo’]}">系统标题</b>

也可以这样访问:

<b th:value="${mapDict.get('sysInfo’)}">系统标题</b>

posted @ 2018-05-07 10:37  huiy_小溪  阅读(4784)  评论(0编辑  收藏  举报