You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by James Hays <ja...@mac.com> on 2003/07/31 14:40:38 UTC

Handling Nulls in OGNL statements

Does anybody have any good tips on handling null objects in OGNL statements?

I often statements like this.  <binding name="value" 
expression="user.office.site.id"/>
Now, with office or site null, it throws back a nasty null pointer error. 

1)  Is it possible to detect this before it tries to render the page?
2)   Is it possible to default to a value if the null occurs?


James


Re: Handling Nulls in OGNL statements

Posted by Harish Krishnaswamy <hk...@comcast.net>.
This thing has come up before, you may find the thread on gmane at 
http://article.gmane.org/gmane.comp.java.tapestry.user/1962

-Harish

James Hays wrote:

> Does anybody have any good tips on handling null objects in OGNL 
> statements?
>
> I often statements like this.  <binding name="value" 
> expression="user.office.site.id"/>
> Now, with office or site null, it throws back a nasty null pointer error.
> 1)  Is it possible to detect this before it tries to render the page?
> 2)   Is it possible to default to a value if the null occurs?
>
>
> James
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>