jQuery in Action, 2nd edition*
The moose likes JSP and the fly likes directory listing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "directory listing " Watch "directory listing " New topic
Author

directory listing

Manisha reddy
Greenhorn

Joined: May 02, 2006
Posts: 16
Hi,

I want develop a JSP page which will list the directories and files.
Could anyone help me in writing the code for the same?

Thanks in advance
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60806
    
  65

Originally posted by Manisha reddy:
I want develop a JSP page which will list the directories and files.


Which directories and files?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Manisha reddy
Greenhorn

Joined: May 02, 2006
Posts: 16
that is the input which is taken at run time. It can be any say "X"
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Directories on the webserver or on the client's machine?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Manisha reddy
Greenhorn

Joined: May 02, 2006
Posts: 16
directories will be on the web server
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Use the java.io.File class to grab the names of all the files and subdirectories you need and store them in some sort of a Collection object. Then display those using JSTL on the JSP.


GenRocket - Experts at Building Test Data
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: directory listing
 
Similar Threads
creating a script
K & B Book Chapter 10 Question 12
set property error?
Folders in Eclipse Java project
How well to list the content of a directory in java?