commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From commons-...@jakarta.apache.org
Subject [jira] Closed: (JELLY-88) Jexl Expressions don't obey scope inheritance
Date Thu, 12 Aug 2004 03:50:20 GMT
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


Mime
View raw message