Yeah, you shouldn't be using cfparam like this at all.

On Dec 25, 2007 8:21 AM, marc -- <[EMAIL PROTECTED]> wrote:

> In Applicationb.cfm I have these lines:
>
> <cfparam name="APPLICATION.objects.security"
> default="#CreateObject('component','components.security
> ').init(authorization='public',language=Left(CGI.HTTP_ACCEPT_LANGUAGE
> ,2))#">
> <cfparam name="APPLICATION.objects.util"
> default="#CreateObject('component','components.util')#">
> <cfparam name="APPLICATION.objects.db"
> default="#CreateObject('component','components.db
> ').init(dsn='irama',maxStringLength=25)#">
> <cfparam name="APPLICATION.objects.cms"
> default="#CreateObject('component','components.cms').init()#">
>
> First time the page gets requested, there's nothing in the APPLICATION
> scope so the lines "CreateObject().init*()" are executed. On subsequent
> calls the APPLICATION scope contains all the objects so I expect that the
> default values (CreateObject().init()) don't get assigned.
> But they do! I put a cfdump in the init handler and _every_ time a page
> gets requested it gets executed. So every time my objects get initialized
> and previous data is lost.
> I thought cfparam only assigns the default value if the variable doesn't
> exist but here it executes it every time.
> Is this a bug or as designed?
>
>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:295337
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to