#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Posts
    1
    Rep Power
    0

    List directory contents in menu


    Hi,

    At the moment i have a static drop down list which consists of a number of options and their associated values. However I want the menu to contain links to the entire contents of a specific directory on my server (c:\stylesheets). I cannot simply hard code the drop down list as the client has the option to upload additional files to the same directory. Does anyone have any suggestions on how I would achieve this? I am using JSP, Java and Javascript.

    Cheers,
  2. #2
  3. No Profile Picture
    Clueless llama
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Feb 2001
    Location
    Lincoln, NE. USA
    Posts
    2,353
    Rep Power
    117
    I am not entirely clear as to your intentions, but if it is what I think you are saying, you can get the contents of a directory when generating the html from a jsp by using the File object and read the contents of the directory. You can then dynamically create your drop down using it. Hope that helps.
  4. #3
  5. dont click here
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    409
    Rep Power
    13
    ahh go through a directory for files..

    check the java API
    http://java.sun.com/j2se/1.4/docs/api/

    there is a File Class there which can do alot
    http://java.sun.com/j2se/1.4/docs/api/java/io/File.html

    if you plan on doing alot of Java Programming I suggest u make that 1st link one of your favorites!

IMN logo majestic logo threadwatch logo seochat tools logo