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 =
> createobject("java","java.net.URL").init("http://www.yahoo.comy")>
>
> <cfdump var="#my_url#"><br />
> getpath<cfdump var="#my_url.getpath()#"><br />
> getauthority<cfdump var="#my_url.getauthority()#"><br />
> getfile<cfdump var="#my_url.getfile()#"><br />
> getquery<cfdump var="#my_url.getquery()#"><br />
> gethost<cfdump var="#my_url.gethost()#"><br />
> getprotocol<cfdump var="#my_url.getprotocol()#"><br />
> getport<cfdump var="#my_url.getport()#"><br />
> getDefaultPort<cfdump var="#my_url.getDefaultPort()#"><br />
> getRef<cfdump var="#my_url.getRef()#"><br />
> getUserInfo<cfdump var="#my_url.getuserinfo()#"><br />
>
> .... will blow up because getref() and getuserinfo() return null.
>
> Should I just set the output of each of those methods into a variable,
> and then check for the variables existence?
>
> Thanks.
>
> ~Brad
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308061
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4