velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <>
Subject Re: velocity & jwaa
Date Sat, 14 Jul 2001 04:12:54 GMT
Tal Dayan wrote:
> >
> > > The template is in a file and a file path is a common notation to refer
> > > to files in the OS.
> >
> > Except that templates aren't always in a file.  They can be in a jar and
> > loaded by the classloader in a webapp, or in a database, or even just a
> > String or a stream.
> Yes, and these are very important features of Velocity (we are using the
> classpath
> loader for example) but it is very likely that for most people, the velocity
> 'hello world'
> program will use a simple file and then when this works, they will move to
> more advanced
> configurations and only then they read the manual. ;-)

That's what servlet_example2 is for - the classloader version is "Light
and get away..."  and will work - you can then alter it to be file
based, and as you say, go from there.

Like I said before with regards to the templates - either way, someone
is going to have to do work :)  There is no perfect solution (that I can

> >
> > The problem is that there is really no such thing as an out-of-the-box
> > configuration - it's a library, so you have to write an application
> > around it.
> Yes, this is exactly what we did, a simple 'main' method that uses the
> Velocity class. However, even a library can have a default configuration
> and behavior.

And it does.  Velocity comes complete with a set of defaults - unlike
other template engines, you don't need to do any configuration to get
going.  One of the choices is that we selected '.' to be the default
directory path for the file resource loader, which is the default
loader.  Of course, if we chose the root of the filesystem (which is
what, by the way, on a windows box???) then we would have someone else
saying that it's too hard because they have to put in the full path to
the template.... I suspect we can't win here.
> BTW, Velocity is now integrated in our application and works just great. We
> use
> it to customize email notification message sent by the system and we were
> very
> impressed how easy it was to integrate it, we simply passed few existing
> entity
> beans to it and all the information was immediately available to the
> template.
> Thanks for all the good people that provided this great product.

> Tal

Geir Magnusson Jr.                 
System and Software Consulting
Developing for the web?  See
You have a genius for suggesting things I've come a cropper with!

View raw message