index.jsp 681 B

12345678910111213141516171819202122232425262728
  1. <%--
  2. Created by IntelliJ IDEA.
  3. User: x'b'w
  4. Date: 2021/5/22
  5. Time: 13:36
  6. To change this template use File | Settings | File Templates.
  7. --%>
  8. <%@ page contentType="text/html;charset=UTF-8" language="java" %>
  9. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  10. <html>
  11. <head>
  12. <title>链接数据库,获取来自数据库的数据</title>
  13. </head>
  14. <body>
  15. <table>
  16. <tr>
  17. <th>学号</th>
  18. <th>姓名</th>
  19. </tr>
  20. <c:forEach items="${list}" var="student">
  21. <tr>
  22. <td>${student.num}</td>
  23. <td>${student.name}</td>
  24. </tr>
  25. </c:forEach>
  26. </table>
  27. </body>
  28. </html>