SW과정 스프링부트 7일차 0903

JongseokLee·2021년 9월 3일
0
post-thumbnail

SW과정 스프링부트 7일차 0903

1. 장바구니 기능 추가

2. Articles List

3. 게시판 jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="java.util.List, com.example.web.vo.Board" %>
<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container">
  <h2>자유게시판</h2>
  <table class="table">
    <thead>
      <tr class="danger">
        <th>글번호</th>
        <th>작성자</th>
        <th>제목</th>
        <th>작성일</th>
      </tr>
    </thead>
    <tbody>
    <%
     List<Board> list=(List<Board>)request.getAttribute("articlesList");
   	 for(Board b:list) {
   		 if(b.getParentNO()==0){
    %>
    	<tr>
        <td><%=b.getArticleNO() %></td>
        <td><%=b.getId() %></td>
        <td><%=b.getTitle() %></td>
        <td><%=b.getWriteDate() %></td>
      </tr>
    <%
   		}else{
   	%>
   			<tr>
   	        <td><%=b.getArticleNO() %></td>
   	        <td><%=b.getId() %></td>
   	        <td>↪<%=b.getTitle() %></td>
   	        <td><%=b.getWriteDate() %></td>
   	      </tr>
   	 <%
   		}
    }
    %>

    </tbody>
  </table>
</div>

</body>
</html>
profile
DataEngineer Lee.

0개의 댓글