person.jsp 855 B

123456789101112131415161718192021222324252627282930313233343536
  1. <%@ page import="com.xbw.java.Person" %><%--
  2. Created by IntelliJ IDEA.
  3. User: x'b'w
  4. Date: 2021/5/21
  5. Time: 20:37
  6. To change this template use File | Settings | File Templates.
  7. --%>
  8. <%@ page contentType="text/html;charset=UTF-8" language="java" %>
  9. <html>
  10. <head>
  11. <title>例子2</title>
  12. </head>
  13. <body>
  14. <%
  15. Person person = new Person(001,"xbw");
  16. session.setAttribute("person",person);
  17. %>
  18. <table>
  19. <tr>
  20. <th>编号</th>
  21. <th>姓名</th>
  22. </tr>
  23. <tr>
  24. <td>${person.no}</td>
  25. <%-- 原理:--%>
  26. <%-- 1.no变大写No;--%>
  27. <%-- 2.获取方法:getNo(),所以返回的是getNo方法--%>
  28. <%-- person后面的.的属性值与方法绑定的--%>
  29. <td>${person.name}</td>
  30. </tr>
  31. </table>
  32. </body>
  33. </html>