JSP File Browser
843836Nov 15 2004 — edited Nov 17 2004Hi All,
I have a requirment to create a list box of all ".csv" and ".xml" files in a serveable directory in tomcat. I say its serveable because when i type in "http://localhost:8080/myApp/test.csv", the file is served up. However this directory contains multiple files and i'd like to create a list box of said files and have the user select which one she'd like to see. I'm having trouble with generating the list in the jsp, here's what i tried to do...
File dir = new File(new URI(request.getRequestURL()));
String[] files = dir.list(new OnlyCSVOrXMLFiles());
for(int i=0; i<files.length; i++)
{
out.println(files);
}
i'm hung up on that first line, it doesn't seem to be the right way to do this... any help would be greatly appreciated. thanks in advance