[ http://issues.apache.org/jira/browse/VELOCITY-277?page=comments#action_12329933 ]
Tim White commented on VELOCITY-277: ------------------------------------ Hey Will - I agree, if macros in #parsed files got picked up when template caching was on, this would be fixed. Up to my eyeballs at the moment, don't really have a simple test case handy. IIRC, if you load your templates from the filesystem, turn template caching on, put some velocimacros in one .vm, and include that .vm via #parse in another, you will have a test case. Seems like when updating a cached .vm from the file system, it doesn't parse it for macros. You end up getting a bunch of "macro undefined" in the main file, since the included file isn't parsed. It works fine the first time you start up the app, becuase everything gets parsed. But, if you update the included .vm (the one with the macros in it), without restarting the app, you will get the error. Something like this: master.vm: #parse("templates/macros.vm") #someMacro(arg) macros.vm: #macro(someMacro $arg) <p>Foo</p> #end Start up app with template caching on, load master.vm in your browser: Foo Update macros.vm with the app running: macros.vm: #macro(someMacro $arg) <p>Bar</p> #end Then try and load master.vm: #someMacro is undefined > macros in #parsed files are not refreshed when including page is refreshed > -------------------------------------------------------------------------- > > Key: VELOCITY-277 > URL: http://issues.apache.org/jira/browse/VELOCITY-277 > Project: Velocity > Type: Bug > Components: Build > Versions: 1.4 > Environment: Operating System: other > Platform: Other > Reporter: Tim White > Priority: Critical > Fix For: 1.5 > > If a template #parses a file containing velocimacros, changes those macros do > not make it into the including template. This is true whether the file is > included via the library property or via #parse. > Although there is the velocimacro.library.autoreload property, it is "not for > use in production" according to the documentation - and cannot be used with > template caching. > Also, often, macros included via #parse do not pick up their macros the first > time they are compiiled. And with template caching they are only ever called > once, this leads to situations where changes in templates that include macros > and are cached do not function in production. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]