Aaron, You're correct that this approach wouldn't work for DWR (at least not in a straightforward way) since DWR uses server side classes that need classloader access to the webapp. But Dojo is different in that it is really just a collection of static resources (javascript, css, images, etc) and does not require any server side communication or even java for that matter. Developers typically just extract all the Dojo resources into their webapp and load them into the browser via references in their HTML.
As a matter of fact Dojo and DWR are quite complimentary to each other since Dojo provides UI controls and DWR provides server communication. As you know, Geronimo already provides DWR as a jar in the repository that can be shared between webapps and versioned separately from the applications that use it. Providing this same type of functionality for Dojo is a little more unnatural since its composed of static resources instead of java class files. But I'm thinking that making the Dojo resources available in a native webapp at a predetermined context provides equivalent functionality except for one limitation: multiple versions of the webapp can not run simultaneously when they use the same context root. IMHO that limitation is acceptable since a large number of use cases are still supported. Best wishes, Paul On 8/11/06, Aaron Mulder <[EMAIL PROTECTED]> wrote:
I'm not sure what you're planning to do with AJAX, but wouldn't Dojo need access to classes in the web app? At least, when we use DWR, we point it to server-side classes and APIs and it automagically generates JavaScript wrappers for those. If so, I'm not sure it would work to have Dojo deployed at a static location like /dojo in a standalone web app, because I'm not sure how it would see the user-specific classes. Maybe some ThreadContextClassLoader magic? Thanks, Aaron On 8/11/06, Paul McMahan <[EMAIL PROTECTED]> wrote: > Dojo is a popular open source AJAX library that's available under the > BSD and Academic Free licenses. The DayTrader folks use it in the web > UI they recently announced on the Geronimo dev list and Chris used it > in the nice LDAP UI he did for GERONIMO-1823. I would also like to > start introducing some use of it into the Geronimo admin console when > its appropriate to do so. > > The way that developers usually incorporate an AJAX library into their > applications is by making a copy of its static files (javascript, css, > gifs, etc) in their webapp and referencing them from their servlets > and JSPs. The obvious downside is that each application has a > separate copy of the AJAX library, increasing the server's overall > disk footprint (Dojo is ~3mb) and preventing the browser from using a > single copy of the library files from its cache. Another downside is > that the AJAX library can't be upgraded independently from the web > application. > > I think it would be great if Geronimo could provide a more AJAX > friendly development environment by helping solve these problems. One > idea is that Geronimo could include the Dojo library as a native, > standalone webapp with its AJAX library files laid out so that other > applications can point at from their HTML. Referencing it in > geronimo-web.xml would cause Geronimo to start it up and make its > files available at some predetermined context root, say /dojo. > Referencing it with a versionless moduleId would make sure the most > recent version is always used. So AJAX enabling your application in > Geronimo would be a simple as "add this line to your > geronimo-web.xml". > > Does this sound like a good idea? Any suggestions or concerns? > Perhaps this could be done as a plugin instead of a native module? > > Best wishes, > Paul >