How can I display content in the form of a Tree using JSP?

Simon Brown

There are a few ways that you could try, although it all depends on any restrictions you have on deployment.

First off, you could use Swing's JTree in a small applet. This would require the use of the Java plug-in on the user's browser so may not be viable for you.

Secondly, you could use one of the Javascript/DHTML "tree controls" that are out there. Take a look on jars.com and I'm sure you'll find one.

Finally, you could write a "tree" using HTML, images and hyperlinks to open up nodes in your tree. This will ensure that you reach the maximum number of target browsers but could be tricky to get right - depending on your experience of HTML.