brand.jsp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  2. <%@ page contentType="text/html; utf-8" pageEncoding="UTF-8" %>
  3. <!DOCTYPE html>
  4. <html lang="en">
  5. <head>
  6. <meta charset="UTF-8">
  7. <title>Title</title>
  8. </head>
  9. <body>
  10. <h1> ${sessionScope.user.username} 欢迎您</h1>
  11. <input style="width: 100px" type="button" value="新增" id="addbrand" ><br>
  12. <hr>
  13. <table border="1" cellspacing="0" width="80%">
  14. <tr>
  15. <th>序号</th>
  16. <th>品牌名称</th>
  17. <th>企业名称</th>
  18. <th>排序</th>
  19. <th>品牌介绍</th>
  20. <th>状态</th>
  21. <th>操作</th>
  22. </tr>
  23. <%-- items 我们要循环的数据源 var 是我们循环得到临时数据变量 --%>
  24. <c:forEach items="${requestScope.brands}" var="brand" >
  25. <tr>
  26. <th>${brand.id}</th>
  27. <th>${brand.brandName}</th>
  28. <th>${brand.companyName}</th>
  29. <th>${brand.ordered}</th>
  30. <th>${brand.description}</th>
  31. <th>
  32. <c:if test="${brand.status == 1}">
  33. 启动
  34. </c:if>
  35. <c:if test="${brand.status != 1}">
  36. 禁用
  37. </c:if>
  38. </th>
  39. <th>
  40. <a href="${pageContext.servletContext.contextPath}/updateBrand?id=${brand.id}" > 修改 </a>
  41. <a href="${pageContext.servletContext.contextPath}/deleteBrand?id=${brand.id}" > 删除 </a>
  42. </th>
  43. </tr>
  44. </c:forEach>
  45. </table>
  46. <script>
  47. document.getElementById("addbrand").onclick = function(){
  48. location.href="<%=request.getContextPath()%>/addBrand.jsp"
  49. }
  50. </script>
  51. </body>
  52. </html>