You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@click.apache.org by "florin.g" <fl...@bytenotes.com> on 2008/11/09 21:44:18 UTC

How to get velocity templates to reload

I've spent a couple of hours trying to get it work and also looked online
with no results.

I am running Click 1.5 on jetty6. The 'webapp/click/VM_global_library.vm' is
not being read no matter what. What works is the 'webapp/macro.vm' file. But
it does not reload even if I use my own velocity.properties file with the
following configuration:

#velocimacro.library=/macro.vm
velocimacro.library.autoreload = true

class.resource.loader.cache = false
#class.resource.loader.modificationCheckInterval = 1

file.resource.loader.cache = false
#file.resource.loader.modificationCheckInterval = 1

The velocity.properties in located in WEB-INF/. It does not have any other
items.

Thanks for any clues.

Florin 
-- 
View this message in context: http://n2.nabble.com/How-to-get-velocity-templates-to-reload-tp1478442p1478442.html
Sent from the click-user mailing list archive at Nabble.com.


Re: How to get velocity templates to reload

Posted by Bob Schellink <sa...@gmail.com>.
Hi Florin,

macro.vm will override VM_global_library.vm:
http://click.sourceforge.net/docs/click-api/net/sf/click/service/VelocityTemplateService.html

If you want to use VM_global_library.vm you'll need to remove macro.vm 
from the webapp. However I would just go with macro.vm as its more 
intuitive.

That said it looks like we have a bug with global macro reloading. 
I've sync'd with the latest Velocity Tools resource loader and it 
solves the issue.

The latest version of the resource loader is here:
http://click.svn.sourceforge.net/viewvc/click/trunk/click/framework/src/org/apache/velocity/tools/view/servlet/WebappLoader.java?revision=3582

Thanks.

bob





florin.g wrote:
> I've spent a couple of hours trying to get it work and also looked online
> with no results.
> 
> I am running Click 1.5 on jetty6. The 'webapp/click/VM_global_library.vm' is
> not being read no matter what. What works is the 'webapp/macro.vm' file. But
> it does not reload even if I use my own velocity.properties file with the
> following configuration:
> 
> #velocimacro.library=/macro.vm
> velocimacro.library.autoreload = true
> 
> class.resource.loader.cache = false
> #class.resource.loader.modificationCheckInterval = 1
> 
> file.resource.loader.cache = false
> #file.resource.loader.modificationCheckInterval = 1
> 
> The velocity.properties in located in WEB-INF/. It does not have any other
> items.
> 
> Thanks for any clues.
> 
> Florin 


Re: How to get velocity templates to reload

Posted by Bob Schellink <sa...@gmail.com>.
Hi Florin,

florin.g wrote:
> 
> Regarding 'setter' chaining, can we look forward some day or just accept it
> as is. 


For now I think we should leave it as is for two reasons:

#1 It would break backwards compatibility if folk had overridden setters.
#2 Java 7 might solve this for us by implicitly returning 'this' from 
void methods.


kind regards

bob

Re: How to get velocity templates to reload

Posted by "florin.g" <fl...@bytenotes.com>.
Thank you so much. Your prompt answers could not be more timely. 

Regarding 'setter' chaining, can we look forward some day or just accept it
as is. Certainly, I am grateful for the framework with or without.




florin.g wrote:
> 
> I've spent a couple of hours trying to get it work and also looked online
> with no results.
> 
> I am running Click 1.5 on jetty6. The 'webapp/click/VM_global_library.vm'
> is not being read no matter what. What works is the 'webapp/macro.vm'
> file. But it does not reload even if I use my own velocity.properties file
> with the following configuration:
> 
> #velocimacro.library=/macro.vm
> velocimacro.library.autoreload = true
> 
> class.resource.loader.cache = false
> #class.resource.loader.modificationCheckInterval = 1
> 
> file.resource.loader.cache = false
> #file.resource.loader.modificationCheckInterval = 1
> 
> The velocity.properties in located in WEB-INF/. It does not have any other
> items.
> 
> I need to mention that click.properties is set to 'trace' (tried debug
> too) and that I am running javarebel.jar for class reloading. 
> 
> Thanks for any clues.
> 
> Florin 
> 

-- 
View this message in context: http://n2.nabble.com/How-to-get-velocity-templates-to-reload-tp1478442p1479007.html
Sent from the click-user mailing list archive at Nabble.com.