Java后台查询到的list怎么放到表格里,如果列有重复的就合并单元格 10

 我来答
萍水相逢本是缘
2016-11-15 · TA获得超过102个赞
知道小有建树答主
回答量:105
采纳率:50%
帮助的人:56.2万
展开全部
           <c:choose> <!-- 直接通过el表达式取 -->
                    <c:when test="${not empty list}">
                        <c:forEach items="${list}" var="u">
                            <tr>
                                <td>
                                <!-- 通过El表达式绑定数据 -->
                                    ${u.userName}
                                </td>
                                <td>
                                    ${u.password}
                                </td>
                                <td>
                                    ${u.loginName}
                                </td>
                                <td>
                                    ${u.sex}
                                </td>
                                <td>
                                    ${u.mobile}
                                </td>
                                <td>
                                    ${u.email}
                                </td>
                                <td>
                                  <a href="<%=request.getContextPath() %>/userServlet?method=userrole&userid=${u.userId}">分配角色</a>
                                </td>
                            </tr>
                        </c:forEach>
                    </c:when>
                    <c:otherwise>
                        <tr>
                            <td colspan="7">
                                没有你要查找的数据
                            </td>
                        </tr>
                    </c:otherwise>
                </c:choose>
本回答被网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式