±×·³.. ½ÇÁ¦·Î º¸¿©Áֱ⠷ÎÁ÷¿¡
ÇØ´çÇÏ´Â JSP ÆäÀÌÁö¸¦ ¸¸µé¾î º¸µµ·Ï ÇÏ°Ú½À´Ï´Ù.
list.jsp |
<%@ page contentType="text/html;
charset=euc-kr" %> <%@ taglib uri="taglib"
prefix="tl"%> <% String PAGE = null; String field = null; String key = null; int current_page; PAGE = request.getParameter("PAGE"); field = request.getParameter("FIELD"); key = request.getParameter("KEY"); if(PAGE == null){
current_page = 1; }else{
current_page = Integer.parseInt(PAGE); } if(field != null){ //key =
new String(key.getBytes("8859_1"),"euc-kr"); }else{ field = ""; key =
""; } %> <jsp:useBean id="Board"
class="board.Board" scope="request"/> <jsp:setProperty name="Board"
property="page" value="<%=current_page%>"/> <jsp:setProperty name="Board"
property="list_cnt" value="17"/> <jsp:setProperty name="Board"
property="field" value="<%=field%>"/> <jsp:setProperty name="Board"
property="key" value="<%=key%>"/> <% int total = Board.getTotal(); int total_page = Board.getTotalPage(); key = new
String(key.getBytes("8859_1"),"euc-kr"); %> |
À§ÀÇ ¼Ò½º´Â ÆĶó¹ÌÅÍ°ªÀ¸·Î ³Ñ¾î¿À´Â °ªµéÀ» ó¸®ÇÑÈÄ ºóÁî¿¡
¼ÂÆÃÇÏ°í ÀÖ½À´Ï´Ù.
ÁÖÀDZí°Ô º¸¼Å¾ß ÇÒ ºÎºÐÀº º¼µåÀÇ ÆĶõ»öÀ¸·Î Ç¥½ÃµÈ ºÎºÐÀε¥
¾Õ¼ ¸»¾¸µå¸° °Í ó·³ µ¥ÀÌÅÍ °¡Á®¿À±â Á¶°Ç¿¡ ÇÊ¿äÇÑ °¢ º¯¼öµéÀ» ¼³Á¤ÇÏ°í ÀÖ½À´Ï´Ù.
ƯÈ÷ ÆäÀÌÁö´ç ¸ñ·ÏÀÇ °³¼ö´Â »ç¿ëÀÚ°¡ ÀÓÀÇ·Î ¼³Á¤°¡´ÉÇϵµ·Ï
Çß½À´Ï´Ù.
¿©±â¼´Â 17 °³·Î µÇ¾î ÀÖ±º¿ä..
°è¼ÓÇؼ ´ÙÀ½À» »ìÆ캸µµ·Ï ÇÏ°Ú½À´Ï´Ù.
list.jsp |
<tl:iterate name="list"
vector="<%=Board.getList()%>" type="board.BoardRec"> <TR> <TD
align=center><jsp:getProperty
name="list" property="num"/></TD>
<TD> <% String re = ""; if(list.depth >= 1){re =
"<img src=img/icon_re.gif>";} for(int
i=0;i<=list.depth;i++){out.println(" ");} %> <%=re%> <a href="view.jsp?PAGE=<%=current_page%>&KEY=<%=key%>&FIELD=<%=field%>&NO=<jsp:getProperty name="list"
property="no"/>"> <jsp:getProperty name="list"
property="subject"/> </a> </TD> <TD align=center> <a href="mailto:<jsp:getProperty name="list"
property="email"/>"> <jsp:getProperty
name="list" property="name"/> </a> </TD>
<TD align=center><jsp:getProperty
name="list" property="regi_date"/></TD>
<TD align=center><jsp:getProperty
name="list" property="cnt"/></TD> </TR>
<tr height=1 align=center><td colspan=5
background="img/back_verdot2.gif"></td></tr> </tl:iterate> |
À§ÀÇ ºÎºÐÀº º¤ÅÍÀÇ ³»¿ëÀ» ű׸¦ ÀÌ¿ëÇÏ¿© ¹Ýº¹ÀûÀ¸·Î ó¸®Çϵµ·Ï
ÇÏ°í ÀÖ½À´Ï´Ù.
ÀÌ Å±״ º¤Å͸¦ ±× ¼Ò½º°ªÀ¸·Î ¹Þ¾Æ¿À°í getProperty ¸¦ ÀÌ¿ëÇÏ¿© º¤Åͳ»ÀÇ °¢ ÇÊµå °ªµéÀ» Ãâ·ÂÇÕ´Ï´Ù.
Èï¹Ì·Î¿î ºÎºÐÀº
Iterate űװ¡ list·Î ¼±¾ðµÇ¾î ÀÖÀ» ¶§ ½ºÅ©¸³Æ²¸´À¸·Îµµ Á¦¾î°¡´ÉÇÏ´Ù´Â °ÍÀÌÁÒ..
<%
String re = "";
if(list.depth >= 1){re = "<img
src=img/icon_re.gif>";}
for(int i=0;i<= list.depth;i++){out.println(" ");}
%>
À§¿Í °°ÀÌ ¾µ¼öµµ ÀÖ½À´Ï´Ù.
ÆäÀÌ¡ ±¸ÇöÀº °øÁö»çÇ׿¡ Àû¿ëµÇ¾ú´ø ¹æ¹ý°ú ¶È °°ÀÌ ¿ÜºÎ JSP ÆÄÀÏÀ» ÀÌ¿ëÇÏ¿´½À´Ï´Ù.