File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes retrive files in a directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "retrive files in a directory" Watch "retrive files in a directory" New topic

retrive files in a directory

swetha deshmukh

Joined: Jul 19, 2005
Posts: 9
Hi everyone,

How can i retrive the files in a directory and display in the text box all the files using jsp.

bye and thanks
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42959
For getting the list of files, check out the method. For displaying them, you would iterate through the result of the listFiles call one by one, and write them inside a <textarea> tag.
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24195

This is not an advanced Java question. Moving to the JSP forum.

[Jess in Action][AskingGoodQuestions]
Srinivasa Kadiyala
Ranch Hand

Joined: Jun 10, 2004
Posts: 237
You can embed HTML Browse tag in jsp file and what ever is in the text field get it using getParameter().

I agree. Here's the link:
subject: retrive files in a directory
jQuery in Action, 3rd edition