Tree servlet 2.0

Simple component lets you display navigation control - tree view. Servlet reads your tree specification from external XML file and renders it in the browser.

Servlet uses Dynatree JQuery plugin.

How to use it:

1) download Dynatree JQuery plugin. Unzip the downloaded file in any directory within your web application. Path to this directory you will describe in servlet's configuration file.

2) download treePackage.jar and save it in WEB-INF/lib

3) describe TreeServlet in web.xml file


4) define a mapping:


you can pass the following parameters for this servlet:

path - describes a path for your resource
type - Optional parameter. Describes a content type for your resource.
expires - Optional parameter. Describes a caching time (in seconds) for the extracted resource.

And now for the usage you have to pass your XML file with tree description (configuration) to this servlet: http://your_host/servlet/TreeServlet?your_config_file. For example, you can use servlet as a source of some frame (iframe) with navigation control: <iframe src="http://your_host/servlet/TreeServlet?your_config_file"> </iframe> etc.

alternatively, you can pass this configuration file as an initial parameter for this servlet. Parameter's name is config:


Configuration file:

It is an XML file.

root node (you can use any name here) has got the following attributes:

style - optional attribute, describes CSS style for the whole control
treeStyle - optional attribute, describes CSS style for the tree itself
title - optional attribute, describes a title for the whole control
plugin - optional attribute, describes a path to dynatree JQuery plugin

the tree itself could be described as a collection of nodes (probably nested). Tag node supports the following attributes:

title - describes a title for node
url - describes an url for node
target - optional attribute, describes a target frame for node's link


    <root style="border:none;background:#FFFFF0">
    <node title="Coldbeans">
     <node title="JSOS" url=""> </node>
     <node title="Coldtags" url=""> </node>
    <node title="Mashups">
     <node title="Photo Map" url=""> </node>

and you will get some like this:

For JSP see also Tree taglib in Coldtags suite

For downloading:

servlet: treePackage.jar  

 © Coldbeans    Comments?

See also JSOS - the largest collection of servlets and filters.

Also in JSOS: