Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to read and list files in Jsp List  RSS feed

 
Kondal reddy
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can I read and list files in my Jsp List, from my C:/Folder/

anybody can help
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66142
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course you realize that you only have access to the server's file system. correct?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!