This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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: 61105
    
  66

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
 
jQuery in Action, 2nd edition
 
subject: directory listing