wood burning stoves
The moose likes JSP and the fly likes Treeview in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Treeview in JSP" Watch "Treeview in JSP" New topic

Treeview in JSP

Greg Belyea

Joined: Jan 11, 2005
Posts: 25
Hey Guys

There is something i am thinking about working on and i would like to get your take on it. I have been out of the javaspace for about 6 months so your opinions would be appreciated.

I want to make a jsp that has a treeview, i want the treeview to mimic the nodes i have in an XML file. I am assuming the only way to get a treeview is to use Javascript which i do not like using. Would i have to build an xml reader, parse the xml then build the tree onload of the page? Is there a better way, or newer technology i am unaware of?


Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
Well, you are in the JSP forum, which means that hopefully you understand that JSP is a server-side technology, while JavaScript is a client-side technology. Ergo, do you want your "treeview" to change once rendered on a user's browser? If you do, then you will need a client-side technology like JavaScript. You could "refresh" your "treeview" by making further HTTP requests from your server, on which some JSP file would have the job of rendering the tree. So, each time the user clicks a "+" to expand a node, it sends some more info to the server and your JSP file renders it all over again from scratch.

Oh, if you just want it rendered once and that's it, JSP is good. After that there's the issue of browser XML plugins, etc. (Yucky!) So, what exactly would you want this "treeview" of yours to do?

Greg Belyea

Joined: Jan 11, 2005
Posts: 25
Well to be honest i was hoping you were gonna bust out some knowledge of Java Server Faces, a static tree structure would not be of much use, it needs to be dynamic, there will be category nodes, and under the category will be link nodes which will take you off to different URL's. The end result will be done with Portals and Portlets. i was just looking for creative opinions/suggestions....

Gary Good

Joined: Jul 09, 2002
Posts: 1
On the JSF side of the house, have a look at Oracle's ADF faces at http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/tagdoc/core/imageIndex.html. This is an early acces release of pre-built components. A tree component is present. Also, check out the Ourfaces JSF component project at https://ourfaces.dev.java.net/ (also http://www.ourfaces.net:8080/ourfaces/)
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63865


Glad that you're here with us on the good ol' JavaRanch and I reckon that you'll find this a helpful and useful site, but we do got us a few rules that y'all got to play by. One of these is that proper ID is required before you can belly on up to the bar. Please take a gander at the JavaRanch Naming Policy and adjust your display name to match it.

The particulars is that your display name must be a first and a last name separated by a space character, and must not be obviously pulling our legs!

Thank ya kindly!
Forum Bartender

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link: http://aspose.com/file-tools
subject: Treeview in JSP
It's not a secret anymore!