You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Nikolaos Konstantinou <nk...@cn.ntua.gr> on 2007/09/26 11:45:39 UTC
OGNL Null Problem
Hi all,
this is my first email at this list but I'll get right to the point:
My task is to upgrade a web application from Tapestry 3.0 to Tapestry 4.1.2.
The problem I encounter is that the OGNL expression :
<a href="#" jwcid="@ExternalLink" page="ListRoomQuotes"
parameters="ognl:new java.lang.Object[] { null, '999',
checkIn == null ? null : checkIn.time,
checkOut == null ? null : checkOut.time,
adultsPerRoom}">
...was validated OK in Tapestry 3.0 but 4.1.2 throws a
org.apache.tapestry.BindingException: Unable to parse OGNL expression ...
After some searching I realize that OGNL version 2.6.9 needs special
handling for null values.
I need to keep the null values in OGNL because the urls produced are
filtered by apache mod_rewrite rules so a tweak like passing 'null' as a
literal wouldn't help.
I also tried ognl:{} but I still get exceptions. Any ideas?
I would sincerely appreciate any help/suggestion
Re: OGNL Null Problem
Posted by Steve Shucker <ss...@vmsinfo.com>.
With the newer ognl I automatically try the #this prefix to see if it
works. Try
ognl:{null, '999', #this.checkIn == null ? null : checkIn.time, #this.checkOut == null ? null : checkOut.time, adultsPerRoom}
or
ognl:{null, '999', #this.checkIn == null ? null : #this.checkIn.time, #this.checkOut == null ? null : #this.checkOut.time, adultsPerRoom}
More likely the first one.
-Steve
Andreas Andreou wrote:
> - Go with T4.1.3 - uses latest OGNL which brings several perf. enhancements.
>
> - Try ognl:{null, '999', checkIn == null ? null : checkIn.time, checkOut
> == null ? null : checkOut.time, adultsPerRoom}
>
> - If that fails, report the problem at
> http://jira.opensymphony.com/browse/OGNL and try
> ognl:{null, '999', checkInValue, checkOutValue, adultsPerRoom}
>
> while adding a getCheckInValue() and a getCheckOutValue()
>
> - Have fun
>
>
> Nikolaos Konstantinou wrote:
>
>> Hi all,
>>
>> this is my first email at this list but I'll get right to the point:
>>
>> My task is to upgrade a web application from Tapestry 3.0 to Tapestry 4.1.2.
>> The problem I encounter is that the OGNL expression :
>>
>> <a href="#" jwcid="@ExternalLink" page="ListRoomQuotes"
>> parameters="ognl:new java.lang.Object[] { null, '999',
>> checkIn == null ? null : checkIn.time,
>> checkOut == null ? null : checkOut.time,
>> adultsPerRoom}">
>>
>> ...was validated OK in Tapestry 3.0 but 4.1.2 throws a
>>
>> org.apache.tapestry.BindingException: Unable to parse OGNL expression ...
>>
>> After some searching I realize that OGNL version 2.6.9 needs special
>> handling for null values.
>>
>> I need to keep the null values in OGNL because the urls produced are
>> filtered by apache mod_rewrite rules so a tweak like passing 'null' as a
>> literal wouldn't help.
>>
>> I also tried ognl:{} but I still get exceptions. Any ideas?
>>
>> I would sincerely appreciate any help/suggestion
>>
>>
>>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: OGNL Null Problem
Posted by Andreas Andreou <an...@di.uoa.gr>.
- Go with T4.1.3 - uses latest OGNL which brings several perf. enhancements.
- Try ognl:{null, '999', checkIn == null ? null : checkIn.time, checkOut
== null ? null : checkOut.time, adultsPerRoom}
- If that fails, report the problem at
http://jira.opensymphony.com/browse/OGNL and try
ognl:{null, '999', checkInValue, checkOutValue, adultsPerRoom}
while adding a getCheckInValue() and a getCheckOutValue()
- Have fun
Nikolaos Konstantinou wrote:
> Hi all,
>
> this is my first email at this list but I'll get right to the point:
>
> My task is to upgrade a web application from Tapestry 3.0 to Tapestry 4.1.2.
> The problem I encounter is that the OGNL expression :
>
> <a href="#" jwcid="@ExternalLink" page="ListRoomQuotes"
> parameters="ognl:new java.lang.Object[] { null, '999',
> checkIn == null ? null : checkIn.time,
> checkOut == null ? null : checkOut.time,
> adultsPerRoom}">
>
> ...was validated OK in Tapestry 3.0 but 4.1.2 throws a
>
> org.apache.tapestry.BindingException: Unable to parse OGNL expression ...
>
> After some searching I realize that OGNL version 2.6.9 needs special
> handling for null values.
>
> I need to keep the null values in OGNL because the urls produced are
> filtered by apache mod_rewrite rules so a tweak like passing 'null' as a
> literal wouldn't help.
>
> I also tried ognl:{} but I still get exceptions. Any ideas?
>
> I would sincerely appreciate any help/suggestion
>
>
--
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org