이전
적용
BoardHandler handler = new BoardHandler();
ArrayList boardList = handler.list();
Board board = null; for(int i = 0; i< boardList.size(); i++)
{
board = (Board)boardList.get(i);%> <tr>
<td align='center'><%=board.getNo()%><br></td>
<td><a href='jsp2/BoardRetrieve.jsp?no=<%=board.getNo()%>'><%=board.getCaption()%></a><br></td>
<td align='center'><%=board.getWriter()%><br></td>
<td align='center'><%=board.getRegdate()%><br></td>
<td align='center'><%=board.getCount()%><br></td>
</tr>
<%}%>
ArrayList boardList = handler.list();
Board board = null; for(int i = 0; i< boardList.size(); i++)
{
board = (Board)boardList.get(i);%> <tr>
<td align='center'><%=board.getNo()%><br></td>
<td><a href='jsp2/BoardRetrieve.jsp?no=<%=board.getNo()%>'><%=board.getCaption()%></a><br></td>
<td align='center'><%=board.getWriter()%><br></td>
<td align='center'><%=board.getRegdate()%><br></td>
<td align='center'><%=board.getCount()%><br></td>
</tr>
<%}%>
적용
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <--standard syntax 설정하고.난후
<c:forEach var="board" items="${boardList}">
<tr>
<td align='center'>${board.no}<br></td>
<td><a href='jsp2/BoardRetrieve.jsp?no=${board.no}'>${board.caption}</a><br></td>
<td align='center'>${board.writer}<br></td>
<td align='center'>${board.regdate}<br></td>
<td align='center'>${board.count}<br></td>
</tr>
</c:forEach>
<tr>
<td align='center'>${board.no}<br></td>
<td><a href='jsp2/BoardRetrieve.jsp?no=${board.no}'>${board.caption}</a><br></td>
<td align='center'>${board.writer}<br></td>
<td align='center'>${board.regdate}<br></td>
<td align='center'>${board.count}<br></td>
</tr>
</c:forEach>
'JAVA' 카테고리의 다른 글
JSTL 기본문법 (0) | 2008.09.17 |
---|---|
[JSTL] <c:url> (0) | 2008.09.11 |
[SWT] 실행파일 배포관련1 (jar파일 만들기-기초편) (0) | 2008.02.22 |
Preferences API 이용해서 레지스트리에 데이터 읽고 쓰기 (0) | 2008.02.14 |
패턴예제 (0) | 2008.01.02 |