i my eyes a nullpropertyhanlder only applies to when you want to set something not when you want to get something.
On 10/27/05, Alexandru Popescu <
[EMAIL PROTECTED]> wrote:
#: Maurice Marrink changed the world a bit at a time by saying on 10/27/2005 11:16 AM :#
> That nullpointer is our problem too and one of the reasons it is being
> changed right now.
> Don't think johan has put in the syntax you just suggested though.
> Afaik it just returns null.
>
IMO evaluating the _expression_ should stop immediately it reaches a null, but without throwing an
exception (probably just some smart logging). Take a look at FreeMarker for example and its annoying
default behavior regarding null handling.
Another solution would be to provide a way to specify a NullPropertyHandler.
./alex
--
.w( the_mindstorm )p.
> ________________________________
>
> Maurice Marrink
> www.topicus.nl
>
> -----Original Message-----
> From: Felix von Delius [mailto:[EMAIL PROTECTED] ]
> Sent: donderdag 27 oktober 2005 11:10
> To: [email protected]
> Subject: Re: [Wicket-user] replace ognl.
>
> I strongly support replacing OGNL with something more performant, as
> long as it is not yet another new syntax for accessing properties (we
> already have OGNL, Spring property access syntax, some _expression_
> languages from the JSP/Taglib world and probably some others). At
> least it sould be OGNL compatible for 90% of the cases. Perhaps using
> the Spring implementation is possible? It is widely tested and I
> suppose it doesn't have the OGNL performance issues.
>
> Further I remember an issue in this mailinglist that in OGNL adressing
> a not existing subtree results in a NullPointerException
> ("customer.address.city.zip" throws NPE if address is null). Maybe a
> new implementation could handle this issue without NPE? (There was the
> suggestion for a syntax like "customer.address?.city.zip", but I'm not
> sure it this is a good idea).
>
> Cheers,
> Felix
>
>
> On 10/27/05, Johan Compagner <[EMAIL PROTECTED]> wrote:
>> Hi
>>
>> I have written a replacement of OGNL when i test it with a very
> simple test
>> (The FormInput example)
>> then i see quite some improvements in cpu speedups and mem
> improvements
>>
>> Around 40% speed increase for a submitting the forminput example page
> 20
>> times
>> and only 1/5 of the memory garbage is generated (50MB against 10MB)
>>
>> The question is what do you guys use of ognl? Can i completely drop
> it or
>> must i make it an option so
>> that you can switch in youre application for all using ognl or the
> homebrew
>> wicket impl.
>> Or make seperate classes (like AbstractPropertyModel) but this is not
>> really doable because then all the
>> sub classes must also be copied...(Like CompoundXX)
>>
>> What i do support now is this:
>>
>> person.name (plain properties)
>> person.addresses.0.street (addresses is a list and i take the first
>> element)
>> person.addresses.homeaddress.street (addresses is map and i take the
>> address with the key 'homeaddress' out of it)
>>
>> so maps and list are seen and the next part of the _expression_ is then
> the
>> key or the index you can also put values in a map
>> or append/set to a list:
>>
>> person.addresses.homeaddress = new Address()
>> person.addresses.10 = new Address()
>>
>> if the list size is smaller then 10 then it will appends null to make
> it
>> that size.
>>
>> addresses can also be an Array but then it won't be able to grow.
>>
>> Ofcourse the person.address.street will just be null if address is
> null, no
>> exception will be thrown
>> if you try to set something on a null object a exception is still
> thrown,
>> Maybe we could make some null handlers for that somehow that are easy
>> useable.
>>
>> So can people live with this? Does anybody uses something different
> of
>> ognl?
>>
>> johan
>>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the JBoss Inc.
> Get Certified Today * Register for a JBoss Training Course
> Free Certification Exam for All Training Attendees Through End of 2005
> Visit http://www.jboss.com/services/certification for more information
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the JBoss Inc.
> Get Certified Today * Register for a JBoss Training Course
> Free Certification Exam for All Training Attendees Through End of 2005
> Visit http://www.jboss.com/services/certification for more information
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
