RE: Trying to understand application.cfc...
Thanks for the tip! -Original Message- From: Paul Day [mailto:p...@nucomsolutions.com] Sent: Thursday, August 12, 2010 2:36 PM To: cf-talk Subject: RE: Trying to understand application.cfc... 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: OnApplicationStart(); 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" Sent: Thursday, August 12, 2010 2:31 PM To: "cf-talk" 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:336243 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Trying to understand application.cfc...
That's most likely what happened... -Original Message- From: Andrew Scott [mailto:andr...@andyscott.id.au] Sent: Thursday, August 12, 2010 2:31 PM To: cf-talk Subject: RE: Trying to understand application.cfc... Rick, Is it highly possible that you had run the application, and then placed that code into onApplicationStart? If this is the case then the undefined variable would make sense, and why it works for you now. Regards, Andrew Scott http://www.andyscott.id.au/ > -Original Message- > From: Rick Faircloth [mailto:r...@whitestonemedia.com] > Sent: Friday, 13 August 2010 4:31 AM > To: cf-talk > 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:336236 > Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm > Unsubscribe: http://www.houseoffusion.com/groups/cf- > talk/unsubscribe.cfm ~| 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:336242 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Trying to understand application.cfc...
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: OnApplicationStart(); 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" Sent: Thursday, August 12, 2010 2:31 PM To: "cf-talk" 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
RE: Trying to understand application.cfc...
Rick, Is it highly possible that you had run the application, and then placed that code into onApplicationStart? If this is the case then the undefined variable would make sense, and why it works for you now. Regards, Andrew Scott http://www.andyscott.id.au/ > -Original Message- > From: Rick Faircloth [mailto:r...@whitestonemedia.com] > Sent: Friday, 13 August 2010 4:31 AM > To: cf-talk > 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:336236 > Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm > Unsubscribe: http://www.houseoffusion.com/groups/cf- > talk/unsubscribe.cfm ~| 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:336239 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to understand application.cfc...
You should be able to set that variable in OnApplicationStart() with no problems. In fact, as you said, that's the preferred place to set it. You must have something else going on that's causing the problem. Thanks, Eric Cobb ECAR Technologies, LLC http://www.ecartech.com http://www.cfgears.com Rick Faircloth wrote: > Ok...I worked with application.cfc's for awhile > and things seemed to work fine, but then I had some > issues and went back to old reliable application.cfm. > > Now, however, I'd like to try again to get a grasp on > how to use application.cfc's. > > First question: > > Why can I set the application.website variable like this: > > > > > > > > But not like this: > > > > > > > > ??? > > > OnApplicationStart would seem to be a more logical place > to set a global variable for an entire application than onRequestStart. > > Rick > > > > ~| 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:336238 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
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:336236 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
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); ... From: "Rick Faircloth" Sent: Thursday, August 12, 2010 2:10 PM To: "cf-talk" Subject: Trying to understand application.cfc... Ok...I worked with application.cfc's for awhile and things seemed to work fine, but then I had some issues and went back to old reliable application.cfm. Now, however, I'd like to try again to get a grasp on how to use application.cfc's. First question: Why can I set the application.website variable like this: But not like this: ??? OnApplicationStart would seem to be a more logical place to set a global variable for an entire application than onRequestStart. Rick ~| 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:336234 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm