This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes JSP and the fly likes how to read and list files in Jsp List Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "how to read and list files in Jsp List " Watch "how to read and list files in Jsp List " New topic
Author

how to read and list files in Jsp List

Kondal reddy
Greenhorn

Joined: Sep 23, 2003
Posts: 22
how can I read and list files in my Jsp List, from my C:/Folder/

anybody can help
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
I think, you mean you want to list down all the file names, of a particular directory, in your JSP page. right?

If yes then its simple just get all the names of files present in particular directory, place them in a collection and then iterate that collection object in order to show the list.

Where is the problem?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Use the java.util.File class for reading your directory.
Then, follow Adeel's directions.
http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

Of course you realize that you only have access to the server's file system. correct?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to read and list files in Jsp List
 
Similar Threads
how to read file
documet viewer
Reading an external list of files from ANT
Printing word doucment using JSP
Reading a textarea as a stream