HomeIndex > Using Dojo in Geronimo

What is Dojo?

Dojo is a popular open source AJAX library made available under the BSD and Academic Free licenses. It provides many useful browser widgets such as tree, table, etc.  Dojo is currently being introduced into the Daytrader application and the Geronimo administration console to enhance the user interface.  See http://dojotoolkit.org/ for more about Dojo.

How is Dojo typically used in a web application?

AJAX developers usually incorporate the Dojo library into their applications by making a copy of its static files (javascript, css, gifs, etc) in their webapp and referencing those files from their servlets and JSPs. The downside of this approach is that each application has a separate copy of the AJAX library, increasing the server's overall footprint and preventing browsers from using a single copy of the library files from their caches. Another downside is that the AJAX library can't be upgraded or otherwise managed independently from the web applications that contain it. For example, a web application deployed across a cluster might need to serve up the static Dojo files from a central location. Hosting the Dojo files in a separate webapp can help work around these problems.

How can Dojo be used in Geronimo?

Geronimo's Dojo plugin provides web applications with a shared copy of the Dojo files. Installing the plugin makes the Dojo files available in the context "/dojo", and the HTML for referencing the library from any web application deployed in that server would look like:

The debug views in the Geronimo administration console use the Dojo plugin. So if the debug views are installed and activated then the Dojo files should already be available in the server at the "/dojo" context. Otherwise, you can manually install the Dojo plugin using the deploy.sh command line tool or the Plugins portlet in the administration console.

How can I tell which version of Dojo is in Geronimo?

To see which version of Dojo is currently available in the server look for "dojo.version" in http://localhost:8080/dojo/dojo/dojo.js.