File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Tree in Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Tree in Servlet" Watch "Tree in Servlet" New topic

Tree in Servlet

Ann Toh
Ranch Hand

Joined: Jul 18, 2003
Posts: 45
Does anyone know how to write tree in servlet program?? i wan to display a tree on a particular directory. My program works like this: different users will have their own directory, so it will display the tree according to their directory. If can, can show me an example...
Thanx in advance...

[ September 30, 2003: Message edited by: Ann Toh ]
Ann Toh
Ranch Hand

Joined: Jul 18, 2003
Posts: 45
can anyone tell me whether inside the servlet, can i hav JTree??
Thanx in advance...
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12682
JTree is used for display in a Swing environment - with a servlet you can only write HTML to be displayed on the user's browser. If you want an active tree display on the user's browser you will have to use something like JavaScript or an applet. In an applet you can have a JTree if the user's browser has the Sun JVM, otherwise not.

Java Resources at
I agree. Here's the link:
subject: Tree in Servlet
Similar Threads
Tree view in a servlet?
directory tree structures
Embedding swings in HTML page
Hiding nodes in a JTree
To implement a tree using struts