123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
- <%@ page import="com.lovecoding.doman.Brand" %>
- <%@ page import="java.util.ArrayList" %>
- <%@ page import="java.util.List" %><%--
- Created by IntelliJ IDEA.
- User: 武恒
- Date: 2023/2/6
- Time: 15:44
- To change this template use File | Settings | File Templates.
- --%>
- <%@ page contentType="text/html;charset=UTF-8" language="java" %>
- <html>
- <head>
- <title>Title</title>
- </head>
- <body>
- <%
- List<Brand> brands = new ArrayList<Brand>();
- brands.add(new Brand(1,"三只松鼠","三只松鼠",100,"三只松鼠,好吃不上火",1));
- brands.add(new Brand(2,"优衣库","优衣库",200,"优衣库,服适人生",0));
- brands.add(new Brand(3,"小米","小米科技有限公司",1000,"为发烧而生",1));
- pageContext.setAttribute("brands", brands);
- %>
- <h4 style="text-align: center;">商品表格</h4>
- <table border="1" cellspacing="0" width="800" align="center">
- <tr align="center">
- <td><b>序号</b></td>
- <td><b>LOGO</b></td>
- <td><b>商品</b></td>
- <td><b>企业</b></td>
- </tr>
- <c:forEach items="${brands}" var="next" >
- <c:if test="${next.id > 1}" >
- <tr align="center">
- <td>${next.id}</td>
- <td><img src="https://p0.itc.cn/images01/20210304/095a3fabfc7e48fdbcdb16e5df45d3fe.jpeg" width="30"></td>
- <td>${next.brandName}</td>
- <td>${next.companyName}</td>
- </tr>
- </c:if>
- </c:forEach>
- <c:forEach begin="0" end="10" var="i" step="1" varStatus="status" >
- ${i} ------ ${status.index + 1 } <br />
- </c:forEach>
- </table>
- </body>
- </html>
|