1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
- <%@ page contentType="text/html; utf-8" pageEncoding="UTF-8" %>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Title</title>
- </head>
- <body>
- <h1> ${sessionScope.user.username} 欢迎您</h1>
- <input style="width: 100px" type="button" value="新增" id="addbrand" ><br>
- <hr>
- <table border="1" cellspacing="0" width="80%">
- <tr>
- <th>序号</th>
- <th>品牌名称</th>
- <th>企业名称</th>
- <th>排序</th>
- <th>品牌介绍</th>
- <th>状态</th>
- <th>操作</th>
- </tr>
- <%-- items 我们要循环的数据源 var 是我们循环得到临时数据变量 --%>
- <c:forEach items="${requestScope.brands}" var="brand" >
- <tr>
- <th>${brand.id}</th>
- <th>${brand.brandName}</th>
- <th>${brand.companyName}</th>
- <th>${brand.ordered}</th>
- <th>${brand.description}</th>
- <th>
- <c:if test="${brand.status == 1}">
- 启动
- </c:if>
- <c:if test="${brand.status != 1}">
- 禁用
- </c:if>
- </th>
- <th>
- <a href="${pageContext.servletContext.contextPath}/updateBrand?id=${brand.id}" > 修改 </a>
- <a href="${pageContext.servletContext.contextPath}/deleteBrand?id=${brand.id}" > 删除 </a>
- </th>
- </tr>
- </c:forEach>
- </table>
- <script>
- document.getElementById("addbrand").onclick = function(){
- location.href="<%=request.getContextPath()%>/addBrand.jsp"
- }
- </script>
- </body>
- </html>
|