Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

retrive files in a directory

 
swetha deshmukh
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For getting the list of files, check out the java.io.File.listFiles 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
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is not an advanced Java question. Moving to the JSP forum.
 
Srinivasa Kadiyala
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can embed HTML Browse tag in jsp file and what ever is in the text field get it using getParameter().
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic