It could be a nice idea, but could be dangerous, it should be optionnal.
I'm looking foward to getting the ognl version that adds a NullHandler. OGNL
2.6.4 ?
Cheers.

Richard HALLIER
Chef de projet
[EMAIL PROTECTED]
01.40.12.41.52
www.uniclick.org
UNICLICK


-----Message d'origine-----
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] la part de
Patrick Lightbody
Envoye : vendredi 17 octobre 2003 05:42
A : [EMAIL PROTECTED]
Objet : RE: [OS-webwork] [OGNL] strange (?) behavior


Actually, this is something I want to add to XWork "some day": a way to
make Ognl automatically create objects for you if they are null. Drew
Davidson (Ognl dude) has already added a NullHandler at my request, we
just haven't implemented it in XWork yet. Eventually, the idea is to be
able to do this:

Foo foo = new Foo();
assertNull(foo.getBar());
stack.setValue("foo.bar.name", "Shazam, bar is created");
System.out.println(foo.getBar().getName());

Output:
Shazam, bar is created

Basically, you wouldn't have to initialize the dependant resources if
there is no-arg constructor.

-Pat

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Fred Lamuette
Sent: Thursday, October 16, 2003 10:13 AM
To: [EMAIL PROTECTED]
Subject: [OS-webwork] [OGNL] strange (?) behavior

I know this problem is not obviously in the scope of this mailing list,
but
I'd like to know if I'm dreaming.

public class Bar
{
        private String name;
        ...
}

public class Foo
{
        private Bar bar;
        ...
}

Executing Ognl.getValue("bar.name",foo) generates an exception when bar
is
null. It was not the expected result ... I expected to a null value.
Maybe I
am accustomed too much to BeanUtils from the Jakarta Project ...
Cheers.
Richard.




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork



-------------------------------------------------------
This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo
The Event For Linux Datacenter Solutions & Strategies in The Enterprise 
Linux in the Boardroom; in the Front Office; & in the Server Room 
http://www.enterpriselinuxforum.com
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to