velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <>
Subject Re: Must Restart Server??
Date Mon, 04 Nov 2002 19:21:44 GMT
On 11/4/02 1:54 PM, "Jenny Brown" <> wrote:

> On Mon, 4 Nov 2002 wrote:
>> Thanks Kevin. I think this is actually a Velocity thing... None of my
>> other servlets require me to start the server, or even the webapp for that
>> matter. It seems like there should be a cache setting somewhere in
>> Velocity that enables me to make changes to a Servlet that extends
>> VelocityServlet without needing to restart the container. Am I wrong?
>> Thanks!
>> Ray
> I have noticed even under Tomcat that if I make a change to a velocity
> template, it reloads automatically, EXCEPT if the change I made was
> inside of a macro, in which case I have to force a servlet container
> restart to see the change.
> I'm not sure why macros are caching, but check if your change was in a
> macro.

Seems like we are mixing things up here.

There are two things :

1) Server restart - this all depends on where you put the Velocity jar, and
where you put your code, and how tomcat is configured.  Tomcat can be
configured to dump your webapp and reload from the lib & classes directory
in your WEB-INF when you change a class or jar.  Velocity 1.3 should have no
problems anymore with this - pre 1.3 there was an issue with the
introspection caching not getting dumped on classloader change, but that's
been fixed.  Also, note that if you have a velocity jar outside of your
webapp, i.e. In tomcats classpath, then you are going to have problems, as
the standard VelocityServlet uses a singleton, and since it is outside of
your webapp classloader (if you keep the jar outside of the webapp), it
doesn't get recycled on webappp change.  The solution, of course, is to just
keep it in the webapp.

2) reloading templates/macros - Velocity can reload both templates and
macros while developing.  You can even reload the global macro library, but
that's probably in the latest dev tree, 1.4.  See the docs.

Geir Magnusson Jr.                                    +1-203-355-2219 (w)
Adeptra Inc.                                         +1-203-247-1713 (m)

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message