velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aapo Laakkonen" <aapo.laakko...@giro.fi>
Subject Global Velocity Macro Reloading
Date Fri, 04 Oct 2002 15:30:45 GMT
I have problems with reloading global Velocity Macros at runtime. Inline
(or local) macros do reload correctly when I make modifications, but
global macros are never reloaded until I restart my servlet engine
(Resin 2.1.4).

My Velocity configuration is here:

runtime.log.logsystem.class=org.apache.velocity.runtime.log.SimpleLog4JL
ogSystem
runtime.log=WEB-INF/log/velocity.log

directive.foreach.counter.name=count
directive.foreach.counter.initial.value=1

velocimacro.library=webwork.vm,form.vm
velocimacro.library.autoreload=true

velocimacro.permissions.allow.inline.to.replace.global=true

resource.manager.logwhenfound=false
resource.loader=file,class

file.resource.loader.description=Velocity File Resource Loader
file.resource.loader.class=org.apache.velocity.runtime.resource.loader.F
ileResourceLoader
file.resource.loader.path=.
file.resource.loader.cache=false
file.resource.loader.modificationCheckInterval=1

class.resource.loader.description=Velocity Classpath Resource Loader
class.resource.loader.class=org.apache.velocity.runtime.resource.loader.
ClasspathResourceLoader
class.resource.loader.cache=false
class.resource.loader.modificationCheckInterval=1

And here is what I get to the log:

2002-10-04 18:22:53,363 - SimpleLog4JLogSystem initialized using logfile
'C:\resin\doc\projectcast\web\WEB-INF\log\velocity.log'
2002-10-04 18:22:53,363 -
************************************************************** 
2002-10-04 18:22:53,363 - Starting Jakarta Velocity v1.3.1-rc2
2002-10-04 18:22:53,363 - RuntimeInstance initializing.
2002-10-04 18:22:53,363 - Default Properties File:
org\apache\velocity\runtime\defaults\velocity.properties
2002-10-04 18:22:53,363 - Trying to use logger class
org.apache.velocity.runtime.log.SimpleLog4JLogSystem
2002-10-04 18:22:53,363 - Using logger class
org.apache.velocity.runtime.log.SimpleLog4JLogSystem
2002-10-04 18:22:53,423 - Default ResourceManager initializing. (class
org.apache.velocity.runtime.resource.ResourceManagerImpl)
2002-10-04 18:22:53,473 - Resource Loader Instantiated:
org.apache.velocity.runtime.resource.loader.FileResourceLoader
2002-10-04 18:22:53,473 - FileResourceLoader : initialization starting.
2002-10-04 18:22:53,473 - FileResourceLoader : adding path
'C:\resin\doc\projectcast\web\'
2002-10-04 18:22:53,473 - FileResourceLoader : initialization complete.
2002-10-04 18:22:53,503 - Resource Loader Instantiated:
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
2002-10-04 18:22:53,503 - ClasspathResourceLoader : initialization
starting.
2002-10-04 18:22:53,503 - ClasspathResourceLoader : initialization
complete.
2002-10-04 18:22:53,533 - ResourceCache : initialized. (class
org.apache.velocity.runtime.resource.ResourceCacheImpl)
2002-10-04 18:22:53,533 - Default ResourceManager initialization
complete.
2002-10-04 18:22:53,563 - Loaded System Directive:
org.apache.velocity.runtime.directive.Literal
2002-10-04 18:22:53,583 - Loaded System Directive:
org.apache.velocity.runtime.directive.Macro
2002-10-04 18:22:53,613 - Loaded System Directive:
org.apache.velocity.runtime.directive.Parse
2002-10-04 18:22:53,653 - Loaded System Directive:
org.apache.velocity.runtime.directive.Include
2002-10-04 18:22:53,663 - Loaded System Directive:
org.apache.velocity.runtime.directive.Foreach
2002-10-04 18:22:54,114 - Created: 20 parsers.
2002-10-04 18:22:54,124 - Velocimacro : initialization starting.
2002-10-04 18:22:54,124 - Velocimacro : adding VMs from VM library
template : webwork.vm
2002-10-04 18:22:55,096 - Velocimacro : added new VM : #action(
action_name name ) : source = webwork.vm
2002-10-04 18:22:55,116 - Velocimacro : added new VM : #execute( name )
: source = webwork.vm
2002-10-04 18:22:55,116 - Velocimacro : added new VM : #bean( bean_name
name ) : source = webwork.vm
2002-10-04 18:22:55,126 - Velocimacro : added new VM : #includeservlet(
name ) : source = webwork.vm
2002-10-04 18:22:55,156 - Velocimacro : added new VM : #url( name ) :
source = webwork.vm
2002-10-04 18:22:55,186 - Velocimacro :  VM library template macro
registration complete.
2002-10-04 18:22:55,186 - Velocimacro : adding VMs from VM library
template : form.vm
2002-10-04 18:22:55,206 - Velocimacro : added new VM : #cat( ) : source
= form.vm
2002-10-04 18:22:55,206 - Velocimacro :  VM library template macro
registration complete.
2002-10-04 18:22:55,206 - Velocimacro : allowInline = true : VMs can be
defined inline in templates
2002-10-04 18:22:55,206 - Velocimacro : allowInlineToOverride = true :
VMs defined inline may replace previous VM definitions
2002-10-04 18:22:55,206 - Velocimacro : allowInlineLocal = false : VMs
defined inline will be  global in scope if allowed.
2002-10-04 18:22:55,206 - Velocimacro : messages on  : VM system will
output logging messages
2002-10-04 18:22:55,206 - Velocimacro : autoload on  : VM system will
automatically reload global library macros
2002-10-04 18:22:55,206 - Velocimacro : initialization complete.
2002-10-04 18:22:55,206 - Velocity successfully started.

Here is the global cat macro:

#macro(cat)
    Miau!
#end

When I change that global macro eg.:

#macro(cat)
    Vuh!
#end

And try redisplay my web page:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title>How to make Cat say Vuh?</title>
    </head>
    <body>
        <p>#cat()</p>
    </body>
</html>

It still says Miau! How can I make that cat act like a dog? I'm using
WebWork's webwork.view.velocity.WebWorkVelocityServlet -servlet as I
also use WebWork. But I think that the problem is not connected to
WebWork.

Do you have some suggestions?


--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message