• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

creating a tree in JSP

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am a newbie in JSPs and would like to have some help with the following problem, I would like to create a tree structure in JSP, say for example depicting the directory structure in windows. The directory structure looks like this

Root
My Computer
C:
test.txt
data.dat
D:
test1.txt
faq.txt
ANOTHER_DIR
xxx1.text
YYY1.dat
My Documents
My Pictures

Under this structure each file if it is a directory,has more files. What would be the best manner in which to achieve this. Would it be to parse the directory structure using J2SE, write it to a XML document and to process this document using JSP or is there any other easier way.

Thanks

Vijai
 
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check Jenkov JSP Tree Tag and JSP Tree Tag.
 
Vijaishanker bala
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks, but I would also like to know how to get the whole directory hierarchy across to the JSP, for example,

 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
They must be having provision for it. Just check the documentation.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A couple of years ago I wrote a bean to facilitate presenting a file system tree in JSP and allowing the user to browse it and forward a selected directory/file to a servlet. Here is the bean code:

In the JSP you have to provide for setting the parameters that control which roots of the file system are browsable - the JSP I used looks like:


Note that the bean does all the HTML formatting and that CSS controls the appearance of directories and files.

Bill
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic