본문 바로가기

기존카테고리/JSP

ArrayList 형변환

 

ArrayList<BoardDto> boardLists =(ArrayList<BoardDto>) request.getAttribute("boardLists");

// ArrayList<BoardDto> boardLists =(ArrayList) request.getAttribute("boardLists");

out.println("boardLists: "+boardLists);

%>

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>Insert title here</title>

</head>

<body>

<table border="1">

<tr>

<td width=100>번호</td>

<td width=200>제목</td>

<td width=100>이름</td>

<td width=100>조회</td>

<td width=100>작성일</td>

</tr>

<%

for(int i=0; i<boardLists.size(); i++){

%>

<tr>

<td width=100><%=boardLists.get(i).getBodIdx()%></td>

<td width=200><%=boardLists.get(i).getBodTitle()%></td>

<td width=100><%=boardLists.get(i).getWriter()%></td>

<td width=100><%=boardLists.get(i).getBodHit()%></td>

<td width=100><%=boardLists.get(i).getRegDate()%></td>

</tr>

<%

}

%>

 

'기존카테고리 > JSP' 카테고리의 다른 글

list 추출에서 pageContext 사용  (0) 2020.04.26
filter  (0) 2020.04.24
현재시간  (0) 2020.04.15
자바빈  (0) 2020.04.08
예외처리  (0) 2020.04.08