From: Marcello H <mar...@gm...> - 2006-08-26 06:13:29
|
I already tried that as well. Did it with all uppercase, lowercase, renamed it to 'hello', to 'test', but still the same effect. Any other suggestions? I know that the file is included, because I wrote '-- testme --' on top. It shows in the browser, if I make a comment of the macro-call. (So that the error isn't showing.) Does it have something to do with the way (the order) that things get parsed? This error tells me that it looks that the parent-tenmplate is parsed somehow before the include. I could check this out by manipulating a variable in the include (not in the macro). If done this to check: #set $myvar="before include" (in the parent) #set $myvar="inside include" (in the included template, and just before that, display $myvar) #set $myvar="after include" (in the parent, after the include) And it shows thjat the var is manipulated in the order that I excpect: before, inside, after. Perhaps it has something to do with the fact that the parent is an include as well, I don't know. So let me include the macro in the higest parent possible. Tested: That's also not working. I did some more researching, and found out some strange behaviour: I've got some macro's working, those are included relative from the parent. (They work!) The one's that don't work, are absolute, with drive-letters and full path-names. I've debug the full-ones, and my slashed are forward slashes (the did always work!) Somehow with the latest java upgrade, they don't. If changed them to backward-slash, and voila, it working like a charm. So this pitfall is found and closed....... 2006/8/25, Lane Sharman <la...@op...>: > > try changing your spelling of macro? > > -Lane > > Marcello H wrote: > > I've got a strange effect with a macro (in the latest CVS release). > > <snip> > -- testme -- > #marco TestMe() > { > You've tested me...... > } > > #TestMe() > </snip> > > If I call the macro from within a template, it runs, but if a put it in a > separate file, it doesn't. > It's complaining about the missing macro. > I've tried include as macro, and include as template, both don't work. > > Here a piece of logging: > > 25-08-2006 09:19:21.796 resource WARNING BrokerTemplateProvider: > Error occured while fetching c:/data/website/templates/page_save.html > org.webmacro.engine.BuildException: #TestMe: no such Macro or Directive at > c:\data\website\templates\page_save.html:123.2 > at org.webmacro.engine.MacroBuilder.build(MacroBuilder.java:66) > at org.webmacro.engine.BlockBuilder.build (BlockBuilder.java:144) > at org.webmacro.engine.WMTemplate.parse(WMTemplate.java:185) > at org.webmacro.resource.BrokerTemplateProviderHelper.load( > BrokerTemplateProviderHelper.java:111) > at org.webmacro.resource.TemplateProvider.load (TemplateProvider.java > :196) > at org.webmacro.resource.CachingProvider.load(CachingProvider.java > :122) > at org.webmacro.resource.ReloadingCacheManager.get( > ReloadingCacheManager.java:204) > at org.webmacro.resource.CachingProvider.get (CachingProvider.java > :111) > at org.webmacro.Broker.get(Broker.java:862) > at org.webmacro.directive.IncludeDirective.getTemplate( > IncludeDirective.java:502) > at org.webmacro.directive.IncludeDirective.getThingToInclude ( > IncludeDirective.java:473) > at org.webmacro.directive.IncludeDirective.write(IncludeDirective.java > :384) > at org.webmacro.engine.Block.write(Block.java:145) > at org.webmacro.engine.Block.evaluate(Block.java :323) > at org.webmacro.directive.SetblockDirective.write( > SetblockDirective.java:92) > at org.webmacro.engine.Block.write(Block.java:145) > at org.webmacro.directive.IfDirective.write(IfDirective.java:210) > at org.webmacro.engine.Block.write(Block.java:145) > at org.webmacro.directive.IfDirective.write(IfDirective.java:210) > at org.webmacro.engine.Block.write(Block.java:184) > at org.webmacro.engine.WMTemplate.write (WMTemplate.java:324) > at org.webmacro.directive.IncludeDirective.write(IncludeDirective.java > :394) > at org.webmacro.engine.Block.write(Block.java:139) > at org.webmacro.engine.WMTemplate.write(WMTemplate.java :324) > at org.webmacro.engine.WMTemplate.evaluateAsString(WMTemplate.java > :253) > at prg.Wsf.writeOutput(Wsf.java:460) > at prg.Wsf.handleRequest(Wsf.java:391) > at prg.Wsf.service(Wsf.java:204) > > > > ------------------------------ > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > ------------------------------ > > _______________________________________________ > Webmacro-devel mailing list > Web...@li...https://lists.sourceforge.net/lists/listinfo/webmacro-devel > > > > -- > Kindest Regards, > > Lane Sharman > 858-342-1415 > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > _______________________________________________ > Webmacro-devel mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webmacro-devel > > > |