You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by co...@jakarta.apache.org on 2004/08/12 05:50:20 UTC

[jira] Closed: (JELLY-88) Jexl Expressions don't obey scope inheritance

Message:

   The following issue has been closed.

   Resolver: dion gillard
       Date: Wed, 11 Aug 2004 8:49 PM

Fixed in CVS already
---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/JELLY-88

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: JELLY-88
    Summary: Jexl Expressions don't obey scope inheritance
       Type: Bug

     Status: Closed
   Priority: Major
 Resolution: FIXED

    Project: jelly
 Components: 
             core / taglib.core
   Fix Fors:
             1.0-beta-4

   Assignee: 
   Reporter: Scott Howlett

    Created: Tue, 30 Sep 2003 11:36 AM
    Updated: Wed, 11 Aug 2004 8:49 PM

Description:
A JexlExpression gets variables via the following JellyMap method: 

    public Object get(Object key) { 
        return context.findVariable( (String) key ); 
    } 

findVariable() locates requested variable in any enclosing scope regardless of inheritance. This is an error - getVariable() ought to be used instead.

The problem can be seen in the following example:

Given these scripts: 

foo.jelly: 

<?xml version="1.0"?> 
<j:jelly xmlns:j="jelly:core"> 
    <j:set var="test" value="goofy"/> 
    <j:import inherit="false" uri="bar.jelly"/> 
</j:jelly> 

bar.jelly: 

<j:jelly xmlns:j="jelly:core"> 
    ${test} 
</j:jelly> 

When I execute foo.jelly, the expression in bar.jelly finds the value of test even though inheritance is false. 



I looked through the CVS history for JexlExpression.java - it looks like the statement in question was inadvertently changed from getVariable() to findVariable() between revisions 8 and 9 (the change is not described in the revision 9 checkin comment).


---------------------------------------------------------------------
JIRA INFORMATION:
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

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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