先导入2个jar包
使用指令
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
标签:EL,标签,brand,JSTL,brandName,表达式 From: https://www.cnblogs.com/zhangsai/p/17633307.html<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
用户名:${brand.brandName}
<input type="button" value="新增">
<br>
<hr>
<table border="1" cellspacing="0" width="800">
<tr>
<th>序号</th>
<th>品牌名称</th>
<th>企业名称</th>
<th>排序</th>
<th>品牌介绍</th>
<th>状态</th>
<th>操作</th>
</tr>
<c:forEach items="${brands}" var="brand">
<tr>
<td>${brand.id}</td>
<td>${brand.brandName}</td>
<td>${brand.companyName}</td>
<td>${brand.ordered}</td>
<td>${brand.description}</td>
<c:if test="${brand.status==1}">
<td>启用</td>
</c:if>
<c:if test="${brand.status!=1}">
<td>禁用</td>
</c:if>
<td><a href="">修改</a>
<a href="">删除</a></td></tr>
</c:forEach>
</table>
</body>
</html>