velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Milo <>
Subject Re: JBoss3.0/Tomcat & Velocity works; template caching question
Date Wed, 10 Jul 2002 15:39:13 GMT
>>So, for development what I do is I deploy my templates.jar into JBoss
>>separately, eg remove templates.jar from mysite.war and deploy both of
>>them into JBoss.  JBoss puts everything in the same "class-space" so it
>>works nicely.  Thus to "deploy" I put mysite.war and templates.jar in my
>>jboss/server/default/deploy dir.  Then all I need to do during
>>development is rejar and redrop the templates.
>>I can actually go a step further and avoid having to jar the templates
>>at all, by building a jar structure in the JBoss deploy directory.  Eg
>>"mkdir server/default/deploy/templates.jar ; cp *.vm
>>server/default/deploy/templates.jar".  Then I can just updated/edit
>>individual tempates without having to package or restart anything.
>>That is what made be start to wonder about velocity's cacheing  wrt to
>>the classpath loader.
>That's a really cute technique.  A little disturbing, but cute.  Any chance
>you could write that up and we can add to our notes in the dev guide on
>working with servlet containers?  I assume it works for tomcat alone?
Yeah, dled Tomcat by itself and gave it a shot.  The trick is to 
creatively use Tomcat's classloader hierarchy.  Note for everybody else 
this is only for development time.  For deployment you should put your 
templates in with your webapp.


 ClassLoader Hierarchy
      /      \
 Catalina   Shared   <--- put your velocity templates here, non-jared
              |  |          eg, |$CATALINA_HOME/classes|
             /   \
        Webapp1  Webapp2 ... 

I'll write something up this weekend.

Back to the caching question wrt to the classpath loader:  How do 
specify the "don't reload my templates"; property the file?  I think the default caching behavior of the 
classpath loader needs to be documented/broadcast further.  All I've 
seen wrt the classpath loader is how to get it working.  ;)  And I bet 
there are people running the classpath loader in production doing mad 
template reparsing.

Milo S.

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

View raw message