You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Gunnar Wagenknecht <gu...@wagenknecht.org> on 2006/03/28 20:28:47 UTC

Macro not executed on first load

Hi!

I've defined a macro in a file that is included in a template using
#parse. On the first page load the macro call is not executed but
printed as is.  If I reload the page immediately it works as desired.

Any ideas?

Cu, Gunnar

-- 
Gunnar Wagenknecht
gunnar@wagenknecht.org
http://wagenknecht.org/


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


Printing the contents of a String variable

Posted by Pascual Queralt <pq...@yahoo.es>.
Well, I have a problem printing the contents of a variable, but it only 
happens sometimes and it's getting me crazy because I don't know why.

As you can see in the code below , I call to the Java method parseOcl2Maude 
ant it returns a string. This string is printed  I after that or at least it 
shoult do it , because it is only printed sometimes.

#* *##set($sResult = 
${i_oeExp2.parseOCL2Maude(${io_sExpVal.trim()},${sContext.trim()}, 
${sModelName.trim ()})} ) ##

$sResult  ##

Nevertheless, if a put the next code it prints the result


#* *##set($sResult = 
${i_oeExp2.parseOCL2Maude(${io_sExpVal.trim()},${sContext.trim()}, 
${sModelName.trim ()})} ) ##

$sResult   +-+ 
${i_oeExp2.parseOCL2Maude(${io_sExpVal.trim()},${sContext.trim()}, 
${sModelName.trim ()})}##



Does anybody know why? Any help will be great.

Many thanks.

    Pascual



----- Original Message ----- 
From: "Gunnar Wagenknecht" <gu...@wagenknecht.org>
To: <ve...@jakarta.apache.org>
Sent: Tuesday, March 28, 2006 8:49 PM
Subject: Re: Macro not executed on first load


> Gunnar Wagenknecht wrote:
>> I've defined a macro in a file that is included in a template using
>> #parse. On the first page load the macro call is not executed but
>> printed as is.  If I reload the page immediately it works as desired.
>
> Some additional debug output. The first time the include file is parsed
> I get something like the following statement.
>
> ---
> Velocimacro : added new VM : #myMacro( ... )
> ---
>
> However, on every reload, I get the following log output.
>
> ---
> Velocimacro : VM addition rejected : myMacro: inline not allowed to
> replace existing VM
> ---
>
> Cu, Gunnar
>
>
>
> -- 
> Gunnar Wagenknecht
> gunnar@wagenknecht.org
> http://wagenknecht.org/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 


		
______________________________________________ 
LLama Gratis a cualquier PC del Mundo. 
Llamadas a fijos y móviles desde 1 céntimo por minuto. 
http://es.voice.yahoo.com

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


Re: Macro not executed on first load

Posted by Gunnar Wagenknecht <gu...@wagenknecht.org>.
Gunnar Wagenknecht wrote:
> I've defined a macro in a file that is included in a template using
> #parse. On the first page load the macro call is not executed but
> printed as is.  If I reload the page immediately it works as desired.

Some additional debug output. The first time the include file is parsed
I get something like the following statement.

---
Velocimacro : added new VM : #myMacro( ... )
---

However, on every reload, I get the following log output.

---
Velocimacro : VM addition rejected : myMacro: inline not allowed to
replace existing VM
---

Cu, Gunnar



-- 
Gunnar Wagenknecht
gunnar@wagenknecht.org
http://wagenknecht.org/


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


Re: Macro not executed on first load

Posted by Will Glass-Husain <wg...@forio.com>.
Hi Gunnar,

This is a known bug.  See
https://issues.apache.org/jira/browse/VELOCITY-146

Best advice - don't define a in a parsed file and use it in the main file.

You might also try the config setting
velocimacro.permissions.allow.inline.local.scope

WILL

On 3/28/06, Gunnar Wagenknecht <gu...@wagenknecht.org> wrote:
> Hi!
>
> I've defined a macro in a file that is included in a template using
> #parse. On the first page load the macro call is not executed but
> printed as is.  If I reload the page immediately it works as desired.
>
> Any ideas?
>
> Cu, Gunnar
>
> --
> Gunnar Wagenknecht
> gunnar@wagenknecht.org
> http://wagenknecht.org/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>


--
Forio Business Simulations

Will Glass-Husain
wglass@forio.com
www.forio.com

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