jar 다운로드: jstl-1.2.jar
세팅 :
Sample test
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
<%@ page language="java" contentType="text/html; charset=EUC-KR" pageEncoding="EUC-KR"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ page import="java.util.ArrayList"%> <%@ page import="java.util.*"%> <% Map<String,ArrayList<String>> mapOfList = new LinkedHashMap<String,ArrayList<String>>(); ArrayList<String> list; for(int i=0;i<13;i++){ list = new ArrayList<String>(); for(int j=0;j<13;j++){ list.add("value"+j); } mapOfList.put("key"+i,list); } request.setAttribute("mapOfList", mapOfList); %> <html> <body> <table> <c:forEach items="${mapOfList}" var="list"> <th> <c:out value="${list.key}"></c:out><br></th> <tr> <c:forEach items="${list.value}" var="listItem"> <td> ${listItem} <br/> </td> </c:forEach> </tr> </c:forEach> </table> </body> </html> |
댓글