You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Reggie Riser (JIRA)" <de...@velocity.apache.org> on 2006/12/27 22:11:22 UTC

[jira] Commented: (VELOCITY-504) Call to evaluate inside of macro fails with 1.5 beta2

    [ http://issues.apache.org/jira/browse/VELOCITY-504?page=comments#action_12461104 ] 
            
Reggie Riser commented on VELOCITY-504:
---------------------------------------

After doing a little tracing, it appears that the foreach counter and the loop variable are showing up in the context for Test 3 in my example when using beta 1, but not appearing in the context in beta 2.  It looks like it may have something to do with local scope as ForEach.java now puts the counter and loop variable in the local context with beta 2.  The call to Velocity.evaluate does not appear to be seeing this local context, thus causing the "cannot be resolved" error.

I'm not that familiar with the Velocity source, so I'd certainly appreciate any help with diagnosing the problem.


> Call to evaluate inside of macro fails with 1.5 beta2
> -----------------------------------------------------
>
>                 Key: VELOCITY-504
>                 URL: http://issues.apache.org/jira/browse/VELOCITY-504
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5 beta2
>         Environment: Windows XP, Sun J2SE 1.5.0_09
>            Reporter: Reggie Riser
>         Assigned To: Henning Schmiedehausen
>         Attachments: macrotest.zip
>
>
> When upgrading from 1.5 beta 1 to beta2, I ran into a problem with one of our macros that makes a call to Velocity.evaluate (via a tool) within a foreach loop.  With beta 1, everything worked fine.  But we get a "cannot be resolved" error with beta 2.  The same code works fine outside of a macro with either version.
> I've distilled the issue we're having down to a simple test case and have attached example code and a build file showing the problem.  Just do an "ant beta1" or "ant beta2" to see how the results differ between beta1 and beta2.

-- 
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: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org