thymeleaf(一)表单循环

java代码

public ModelAndView index() {
        ModelAndView modelAndView = new ModelAndView(DEFAULT_VIEW);
        CustomizeProcessVo customizeProcessVo = new CustomizeProcessVo();
        customizeProcessVo.setSpId(Long.valueOf(1));
        customizeProcessVo.setPage(new Pagination(1));
        RestPageResult<CustomizeProcessDto> flowList =  customizeProcessClient.page(customizeProcessVo);
        List<CustomizeProcessDto> customizeProcessDtoList = flowList.getPage().getContent();
        modelAndView.addObject("channelInfo",customizeProcessDtoList);
        return modelAndView;
    }

数据结构


html代码 zdy是自定义,后面是key值

<tr  th:each="zdy : ${channelInfo}">
                            <td th:text="${zdy.spId}">Onions</td>
                            <td th:text="${zdy.spId}">Onions</td>
                            <td th:text="${zdy.spId}">Onions</td>
                            <td th:text="${zdy.spId}">Onions</td>
                            <td th:text="${zdy.spId}">Onions</td>
                            <td th:text="${zdy.spId}">Onions</td>
                        </tr>

结果


猜你喜欢

转载自blog.csdn.net/sicily_winner/article/details/79725648
今日推荐