Get a list of directories for JSPFrom WikiJava
this example shows how to render with a JSP the directory listing on the hard disk on the server.
the articlethe example uses directories jsp<h1>Directories</h1> <ul> <% String root="c:/Repository/WebApplication/mydocs/javadoc/"; java.io.File file; java.io.File dir = new java.io.File(root); String[] list = dir.list(); for (int i = 0; i < list.length; i++) { file = new java.io.File(root + list[i]); if (file.isDirectory()) { %> <li><a h ref="javadoc/<%=list[i]%>" target="_top"><%=list[i]%></a><br> <% } } %> </ul>
See Also |
