Rick,

One thing I do is to place a piece of code into the onRequestStart method to 
reinit the application variables. This will let you set variables in the 
onApplicationStart method and be able to change them without having to restart 
ColdFusion or wait for the application to timeout.

In you onRequestStart() function, place the following:

<cfif StructKeyExists(URL, "reinit")>
   <cfscript>
      OnApplicationStart();
   </cfscript>
</cfif>

Then, call your website like http://www.yourwebsite.com?reinit=1

This will allow you to update your Application scoped variables if you have 
them all set up in the onApplicationStart() function.

Paul

Paul Day
Principal / Developer

410.241.8465
p...@nucomsolutions.com
http://www.nucomsolutions.com/

----------------------------------------

From: "Rick Faircloth" <r...@whitestonemedia.com>
Sent: Thursday, August 12, 2010 2:31 PM
To: "cf-talk" <cf-talk@houseoffusion.com>
Subject: RE: Trying to understand application.cfc... 

Thanks for the reply, Jason...

Well...I swear, the first time I tried to set application.website
inside onApplicationStart, I got an error saying application.website
wasn't defined. Now, for some reason, it works.

The only thing I added was output="false" as you have in your example.

At first, I used:

Any wrong or missing?

-----Original Message-----
From: Jason Fisher [mailto:ja...@wanax.com] 
Sent: Thursday, August 12, 2010 2:17 PM
To: cf-talk
Subject: re: Trying to understand application.cfc...

I do exactly that, Rick, and it works fine. All my app vars are set in 
onApplicationStart, except for the constants like 'name', which I set 
outside the methods:

this.name = "myAppName";
this.applicationTimeout = createTimeSpan(0, 8, 0, 0);
...



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336241
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to