123456789101112131415161718192021222324252627282930313233343536 |
- <%@ page import="com.xbw.java.Person" %><%--
- Created by IntelliJ IDEA.
- User: x'b'w
- Date: 2021/5/21
- Time: 20:37
- To change this template use File | Settings | File Templates.
- --%>
- <%@ page contentType="text/html;charset=UTF-8" language="java" %>
- <html>
- <head>
- <title>例子2</title>
- </head>
- <body>
- <%
- Person person = new Person(001,"xbw");
- session.setAttribute("person",person);
- %>
- <table>
- <tr>
- <th>编号</th>
- <th>姓名</th>
- </tr>
- <tr>
- <td>${person.no}</td>
- <%-- 原理:--%>
- <%-- 1.no变大写No;--%>
- <%-- 2.获取方法:getNo(),所以返回的是getNo方法--%>
- <%-- person后面的.的属性值与方法绑定的--%>
- <td>${person.name}</td>
- </tr>
- </table>
- </body>
- </html>
|