zoukankan      html  css  js  c++  java
  • JSP和JSTL视图解析器

    使用JSTL

    users.jsp

     1 <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
     2 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
     3 <!DOCTYPE html>
     4 <html>
     5     <head>
     6         <title>JSTL Demo</title>
     7     </head>
     8     
     9     <body>
    10         <table>
    11             <thead>
    12             <tr>
    13                 <th>ID</th>
    14                 <th>UserName</th>
    15                 <th>Name</th>
    16                 <th>Age</th>
    17             </tr>
    18             </thead>
    19             <tbody>
    20                 <c:forEach items="${users}" var="user">
    21                     <tr>
    22                         <td>${user.id}</<td>
    23                         <td>${user.userName}</<td>
    24                         <td>${user.name}</<td>
    25                         <td>${user.age}</<td>
    26                     </tr>
    27                 </c:forEach>
    28             </tbody>
    29         </table>
    30     </body>
    31 </html>

    封装集合对象

    效果:

  • 相关阅读:
    cJson
    STemWin
    TEA通讯加密
    stm32串口收发导致的死机
    C语言版数据结构算法
    FIFO
    IAP远程在线升级
    LWIP
    电能计量芯片
    单片机里的堆栈
  • 原文地址:https://www.cnblogs.com/ZHOUVIP/p/7255812.html
Copyright © 2011-2022 走看看