No time to look at this right now,  but if you file a jira report here:

http://jira.opensymphony.com/browse/OGNL

it can be looked in to for the next 2.7.1 release.

The forums are here:

http://forums.opensymphony.com/category.jspa?categoryID=10

(though I'm thinking of moving them to google groups as well)

On 6/26/07, Kalle Korhonen <[EMAIL PROTECTED]> wrote:

Hi Jesse et al,

while trying to migrate to Tap 4.1.2 we started getting lots of
OgnlExceptions with message "source is null" from OgnlRuntime.getProperty.
The workaround was to add #this to a lot of places where we used more
complex OGNL expressions. I realize this is probably much more to do with
enhanced Ognl than Tapestry, so I would have taken the discussion to ognl
list, but subscribing to ognl-interest failed with lists.ognl.org domain
not
found. Anyway, an example of failing expression is:
ognl:object[linkProperty]

that now only works with:
ognl:object[#this.linkProperty]

Without knowing anything about how compiled OGNL works, just following the
ExpressionEvaluatorImpl.java source I tried to make a test case that
fails:
    public String getKey() {
        return "key";
    }

    public void testEnhancedOgnl() throws Exception {
        map = new HashMap();
        map.put("key", "value");
        ClassResolver ognlResolver = new OgnlClassResolver();
        OgnlContext context = (OgnlContext)Ognl.createDefaultContext(this,
ognlResolver);
        Node expression = Ognl.compileExpression(context, map, "key");
        assertEquals(map.get("key"), Ognl.getValue(expression.getAccessor
(),
context, map)) ;

        context = (OgnlContext)Ognl.createDefaultContext(this,
ognlResolver);
        expression = Ognl.compileExpression(context, this, "#this[key]");
        assertEquals("key", Ognl.getValue(expression.getAccessor(),
context,
this)) ;

        context = (OgnlContext)Ognl.createDefaultContext(this,
ognlResolver);
        expression = Ognl.compileExpression(context, this, "#this.key");
        assertEquals("key", Ognl.getValue(expression.getAccessor(),
context,
this)) ;

        // Fails
        context = (OgnlContext)Ognl.createDefaultContext(this,
ognlResolver);
        expression = Ognl.compileExpression(context, this, "key");
        assertEquals("key", Ognl.getValue(expression.getAccessor(),
context,
this)) ;
    }


I might be way off here (like I said, I don't know anything about it :),
but
the last assert fails (on CannotCompileException) even though to me the
expression is equal to the two above it (the first one's just me figuring
out how it works).

Since 2.7 is already released and I can see Jesse has even tagged Tap4.1.2a
few hours ago, I was mostly looking for a quick explanation, maybe a
better
workaround if possible. If this (pun intended) is the price to pay for
faster OGNL, here's my check and huge thanks to Jesse for all the hard
work!

Kalle




--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

Reply via email to