Java NULL in CF

2008-06-24 Thread Brad Wood
What's the best way to test for a Java NULL in CF? For instance, the following code: cfset my_url = createobject(java,java.net.URL).init(http://www.yahoo.comy;) cfdump var=#my_url#br / getpathcfdump var=#my_url.getpath()#br / getauthoritycfdump var=#my_url.getauthority()#br / getfilecfdump var

Re: Java NULL in CF

2008-06-24 Thread Barney Boisvert
Yeah, using structKeyExists or isDefined is what you have to do. Kind of annoying, but such is life. cheers, barneyb On Tue, Jun 24, 2008 at 9:26 AM, Brad Wood [EMAIL PROTECTED] wrote: What's the best way to test for a Java NULL in CF? For instance, the following code: cfset my_url

Re: Java NULL in CF

2008-06-24 Thread Pete Jordan
Brad Wood wrote: What's the best way to test for a Java NULL in CF? Should I just set the output of each of those methods into a variable, and then check for the variables existence? That'll work. cfset path=my_url.getpath()/ cfif isdefined('path') !--- ... --- /cfif We use a little Java

RE: Java NULL in CF

2008-06-24 Thread Brad Wood
Thanks Barney. I did dig up a little snippet of help while Googling. The trim() and len() functions will accept a null and return an empty string and 0 respectively. #trim(Obj.i_return_null())# returns empty string #len(Obj.i_return_null())# returns 0 Thanks. ~Brad -Original

Re: Java NULL in CF

2008-06-24 Thread Pete Jordan
Ach! It stripped it. Here's the class: package horus.coldfusion; // Java-end NULL-surrogate bits for ColdFusion // Copyright © 2007-2008, Horus Web Engineering Ltd. All rights reserved. public class undefined { private Class test=null; public undefined () { this.test=this.getClass();

RE: Java NULL in CF

2008-06-24 Thread Brad Wood
] Sent: Tuesday, June 24, 2008 12:35 PM To: CF-Talk Subject: Re: Java NULL in CF Brad Wood wrote: What's the best way to test for a Java NULL in CF? Should I just set the output of each of those methods into a variable, and then check for the variables existence? That'll work. cfset path

Re: Java NULL in CF

2008-06-24 Thread Mark Mandel
12:35 PM To: CF-Talk Subject: Re: Java NULL in CF Brad Wood wrote: What's the best way to test for a Java NULL in CF? Should I just set the output of each of those methods into a variable, and then check for the variables existence? That'll work. cfset path=my_url.getpath()/ cfif