Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JSP File Browser

843836Nov 15 2004 — edited Nov 17 2004
Hi 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 15 2004
Added on Nov 15 2004
2 comments
209 views