%@ page import="com.lovecoding.doman.Brand" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Iterator" %><%--
Created by IntelliJ IDEA.
User: 武恒
Date: 2023/2/6
Time: 15:19
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
Title
<%
// 查询数据库
List brands = new ArrayList();
brands.add(new Brand(1,"三只松鼠","三只松鼠",100,"三只松鼠,好吃不上火",1));
brands.add(new Brand(2,"优衣库","优衣库",200,"优衣库,服适人生",0));
brands.add(new Brand(3,"小米","小米科技有限公司",1000,"为发烧而生",1));
%>
商品表格
序号 |
LOGO |
商品 |
企业 |
<%
Iterator iterator = brands.iterator();
while ( iterator.hasNext() ) {
Brand next = iterator.next();
request.setAttribute("next", next);
%>
${next.id} |
 |
${next.brandName} |
${next.companyName} |
<%
/**
* EL 表达式 的用途
* EL 他没有空指针的顾虑, 也没有数组下标越界的担心, 非常的自由
* EL 作用就是 在四个域内 查找KEY值 并输出到页面上
* EL 没有字符串拼接功能
* EL param cookie header initParam 内置对象
*/
}
%>