source: other-projects/nz-flag-design/trunk/similarity-2d/list-flags.jsp@ 29633

Last change on this file since 29633 was 29621, checked in by davidb, 9 years ago

Changes after some debugging with a larger set of images

File size: 989 bytes
Line 
1 <%
2 String docBase = getServletContext().getRealPath("/");
3 File similarityDir = new File(docBase,"similarity-2d");
4 File imagesDir = new File(similarityDir,"Images");
5
6 ArrayList<File> imageFileList = listFilesForFolder(imagesDir,".gif");
7
8 File imageUrlBase = new File("Images");
9
10 String action = request.getParameter("action");
11
12 out.println("<script>");
13 out.println("var dynamic_img_list = [ ");
14 boolean first_entry = true;
15 for (final File fileEntry : imageFileList) {
16 String flagImageUrl = imageUrlBase + "/" + fileEntry.getName();
17
18 if (first_entry) {
19 out.println("\"" + flagImageUrl + "\"");
20 first_entry = false;
21 }
22 else {
23 out.println(",\"" + flagImageUrl + "\"");
24 }
25 }
26 out.println("];");
27
28 out.println("is_jsp_active = true;");
29 out.println("img_list = dynamic_img_list;");
30
31 out.println("</script>");
32
33 %>
Note: See TracBrowser for help on using the repository browser.