Its somewhat disappointing that both WebWork and Spring which have out-of-box support for Velocity (which is great!) seem to treat Velocity like JSP (which is bad!) in the rendering aspect.
Velocity templates cannot stand-alone (unlike JSP), and almost always need to be accompanied by some kind of template helper (action/controller) to retrieve the objects they need and stuff them into their context.
Really, I don't see very much value in forwarding directly to a Velocity template without going through a template helper, unless you've got sophisticated Turbine-style Pull tools (ick!) or the template only uses the context tools.
When using WebWork, I found myself declaring a View abstract class which subclasses Action, and all template helper classes subclass View.
What's the recommended way of doing this in Spring? As an Interceptor, or simply by adding one Controller per template? Or am I missing something completely?


Reply With Quote