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

Last change on this file since 29608 was 29608, checked in by davidb, 6 years ago

Switch to using JESSIONID as part of the flagname, so everyone visiting the site gets to design their flag in private.

File size: 1.0 KB
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 //out.println("<img src=\"" + flagImageUrl + "\">");
19 if (first_entry) {
20 out.println("\"" + flagImageUrl + "\"");
21 first_entry = false;
22 }
23 else {
24 out.println(",\"" + flagImageUrl + "\"");
25 }
26 }
27 out.println("];");
28
29 out.println("is_jsp_active = true;");
30 out.println("img_list = dynamic_img_list;");
31
32 out.println("</script>");
33
34 %>
Note: See TracBrowser for help on using the repository browser.