方法一:使用map的方式获取值,即使用 ${item.get(‘helperImg’)} 替换 ${item.helperImg}。
<img width="200" height="100" alt="logo" th:src="${helpInfo?.get('helperImg')}"
style="max-width: none;">
方法二:判断后台传递过来的值,是否为空,来做一些业务上的处理。
<div class="col-md-6" th:if="${not #strings.isEmpty(item.helperImg)}">
方法三:三目运算符进行判断
<input type="text" th:value="${item!=null ?item.helperImg:''}">
<input type="text" class="form-control" th:value="*{helperImg}">