History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: OGNL-43
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Jesse Kuhnert
Reporter: Ben Dotte
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OGNL

getValue() not called on second parameter to && if the first returns true

Created: 16/Apr/07 12:48 PM   Updated: 18/Apr/07 04:28 PM
Component/s: ExpressionCompiler
Affects Version/s: 2.7
Fix Version/s: 2.7

Environment: Tapestry 4.1.2 snapshot from 4-16, OGNL 2.7 snapshot from 4-14, WinXP, Firefox 2


 Description  « Hide
According to the OGNL documentation, if the first parameter of an && expression returns true, getValue() should be called on the second parameter to return its value: http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/apa.html#operators

For example this prints "2" in OGNL 2.6, whereas it prints "true" in 2.7:

.html:
<span jwcid="@Insert" value="ognl:true && myInt" />

.java:
public int getMyInt()
{
return 2;
}

This is not the way I would typically use && but it is nonetheless documented to evaluate the second parameter and I know people who do use it that way.

 All   Comments   Change History      Sort Order:
Jesse Kuhnert - [18/Apr/07 04:28 PM ]
Ah, good catch. (though painful to fix)