No offence taken, but I do have some comments, which are below...

yeah, no offense intended to David Johnson, but that's a
really poor way to use Velocity.  it looks as though that
method is intended to spit out some HTML hardcoded into
whatever $macros is or some such thing.  the HTML shouldn't
come from the java, it should be in the template to begin
with, or at least defined the global Velocimacro library.
that way the code could just be:

#showNavBar( true)

anyway, i hope i'm not coming off too argumentative, it's
just that these are poor examples of using velocity.  i
wouldn't want people to get the wrong idea. :)

In the case of the NavBar, there was an existing JSP NavBar tag and I wanted to use that NavBar from Velocity. In general, I think you (whoever you are) are correct: the Velocity template (or a Velocity macro) should be responsible for creating the HTML based on the model objects that have been placed into the context.

If we want to follow your advice in Roller development, we should stop adding HTML generation methods to our $macros object. Instead we should put the right objects into the Velocity context and let Velocity do the rendering, possibly by calling upon Velocity macros.

It would also be an interesting experiment to see how people would
approach this with JSP (and probably using Tiles for the standard layout

I' not sure how you would do user-editable weblog page templates using JSP, that is why I did it using Velocity. I don't think you want users editing JSP templates, in fact you don't even want them to be able to access the request and response objects - it's just too dangerous.

- Dave

To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to