thymeleaf的th:each遍历获取参数并用split字符串,显示多图片
`<div class="form-group">
<div th:each="image : ${#strings.listSplit(webProduct.pic,';')}">
<label class="col-sm-3 control-label">产品图片:</label>
<div class="col-sm-8">
<img th:src="${image}" id="imagepath1" name="imagepath" style="width: 210px;height: 210px">
</div>
</div>
</div>`
其中,#strings.listSplit为方法; webProduct为后端的实体类; pic为属性,按照“;” 切割。
后端的地址为:pic: /profile/productPic/1634534287477.jpg;/profile/productPic/1634534288098.jpg;/profile/productPic/1634534288679.jpg;/profile/productPic/1634801735652.jpg;/profile/productPic/1634801735655.jpg