1.基础属性
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <%@ page import="com.tgb.*" %> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; List list=(List)request.getAttribute("list"); %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
2.遍历list
<c:forEach items="${list}" var="user" varStatus="vs"> <tr> <td align = "center">${user.getID()}</td> <td align = "center">${user.getUserName()}</td> <td align = "center">${user.getPassword()}</td> <td align = "center"><img src="${user.getHeadImage()}" style="height: 50px;width: 50px;"/></td> <td> <a href="user.html"><i class="icon-pencil"></i></a> <a href="#myModal" role="button" data-toggle="modal"><i class="icon-remove"></i></a> </td> </tr> </c:forEach>
3.加载子页面
<jsp:include page="../../layout/footer.jsp"></jsp:include>
时间: 2024-10-18 01:27:22