使用JSTL遍历List集合
使用JSTL遍历List集合
关键代码:
使用jstl需要使用Jstl.jar和Standard.jar两个Jar包
1 <%@ page isELIgnored="false" %> 2 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 4 <c:forEach var="userList" items="${ list }"> 5 <tr> 6 <td>${userList.id}</td> 7 <td>${userList.username }</td> 8 <td>${userList.password }</td> 9 <td>${userList.birthday }</td> 10 <td>${userList.salary }</td> 11 <%-- 也可以<td><c:out value="${userList.id}"/></td> --%> 12 </tr> 13 </c:forEach>
by hacket

浙公网安备 33010602011771号