Created
June 30, 2010 10:42
-
-
Save codebrane/458509 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ page contentType="text/html;charset=UTF-8" language="java" %> | |
<%@ page import="java.io.File" %> | |
<% | |
String url = request.getRequestURL().toString(); | |
String dirToList = request.getRealPath(request.getServletPath()); | |
File jsp = new File(dirToList); | |
File jspDirectory = jsp.getParentFile(); | |
File[] dirContents = jspDirectory.listFiles(); | |
%> | |
<table> | |
<% | |
for (File file : dirContents) { | |
String href = url + file; | |
%> | |
<tr><td><a href="<%= file.getName() %>"><%= file.getName() %></a></td></tr> | |
<% | |
} | |
%> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment