On 3/7/06, Sean Gilligan <[EMAIL PROTECTED]> wrote: > I don't know the answer either -- I looked at WebWork briefly and it > doesn't seem to have this thin-wrapper-around-Servlets subset that > applies well to org.roller.presentation.velocity. But I might have > missed something.
The online documentation for WebWork doesn't do it justice, though the new start page is an improvement. * http://wiki.opensymphony.com/display/WW/EasyStartPage I'm working on updating the documentation and the example applications as part of the WebWork migration to Apache Struts, but I've only just started on that this week. As Matt Raible might say, WebWork has three major "sweet spots": interceptors, result types, and UI tags. * Inteceptors. The request processing lifecyle is built-up from a series of "interceptors". WebWork interceptors use the same design strategy as servlet filters. You can write one interceptor that can pre- and post-process the request. The interceptors can be grouped together into a stack. You can use one stack for the entire application, or define special stacks for certain requests, or mix-and-match stacks as needed. Interceptors are used to handle validation, populating objects, logging, and any other "front controller" behavior you'd like to share between actions. By declaring which interceptors are on the stack, the developer decides how much, or how little, the framework does. As a test-first developer, what I like best about inceptors is that they are not just for web applications. Business logic can use interceptors too, and interceptor logic can be tested in isolation. * Result Types. Unlike Struts ActionForwards, WebWork results are reusable objects that can post-process the request, if needed. Rather than just transfer to a resource, WebWork result types are used to create Jasper reports and stream to Velocity templates. In a Roller context, WebWork Results might be a good way to encapsulate the various syndication formats. * UI Tags. The WebWork tag library is based on templates and stylesheets. What markup is output is determined by a FreeMarker template (same idea as Velocity). If you want to change the output for a given tag, you can plug in a new template for just that tag, and it will automatically override the default. The UI tags themselves are stylesheet driven. The stylesheet skins let you do things like use one (count it: 1) tag to output the label, the control, and the validation message. And WebWork 2.2 already uses Spring under the covers. (Gotta love Spring!) Overall, I would say that Webwork is to Struts, what Subversion is to CVS. The same general idea, only better. Much better. -Ted.
