[ 
https://issues.apache.org/jira/browse/VELOCITY-288?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Henning Schmiedehausen closed VELOCITY-288.
-------------------------------------------


> variables not resetting if set to null
> --------------------------------------
>
>                 Key: VELOCITY-288
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-288
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.4
>         Environment: Operating System: All
> Platform: All
>            Reporter: Kevin Ward
>         Assigned To: Velocity-Dev List
>
> In a loop over values in an array a variable is set to a non-null value. When 
> a subsequent value is null, the initial variable retains the previous value 
> rather than being set to null.
> Example:
> #set ($array = [ "hello", $null, "tomorrow" ])
> #foreach ($item in $array)
>    #set ($text = $item)
>    <pre>
>    array: $item
>    text: $text
>    </pre>
> #end
> For this code, the output is:
> array: hello
> text: hello
> array: hello
> text: hello
>       
> array: tomorrow
> text: tomorrow
> However, the output *should* be:
> array: hello
> text: hello
> array: $item
> text: $text
>       
> array: tomorrow
> text: tomorrow

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to