Re: Application.cfc question
to get the application.cfc in the subfolder to run, then your original request would have to be to the subfolder. CF bases which application.cfc to fire upon the originating request, then travels up the tree til it finds one (not down, as you are trying to do) Steve 'Cutter' Blades Adobe Community Professional Adobe Certified Expert Advanced Macromedia ColdFusion MX 7 Developer http://cutterscrossing.com Co-Author Learning Ext JS 3.2 Packt Publishing 2010 https://www.packtpub.com/learning-ext-js-3-2-for-building-dynamic-desktop-style-user-interfaces/book The best way to predict the future is to help create it On 11/25/2013 12:30 PM, Eric Roberts wrote: Here's the background... We have all of our requests going through the index.cfm in the root and depending on variable values, they get directed, via cfincludes, to subfolders. My question is how do I get the application.cfc in the subfolder to run? The application.cfc in the root is getting run, but it appears that the one in the subfolder is not. Each sub-folder contains a separate application with a unique name and the application.cfc has application specific variables in it. The application.cfc in the subfolder is set to extend the one in the root. Eric ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357130 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Application.cfc question
I would tend to agree that you cannot do it this way because the application.cfc fires on first request. If you can use IIS (or Apache) to do your redirect before the application.cfc fires you should be able to get the ones in the subfolders to fire first, then do an include at the top of each to include the original application.cfc file to add the missing data... but I'd probably not call the one in the root application.cfc then... probably something like global_var_include.cfm or something. Robert Harrison Director of Interactive Services Austin Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austin_ ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357131 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Application.cfc question
That is what I was afraid of ;-) Thanks Steve! -Original Message- From: Steve 'Cutter' Blades [mailto:cold.fus...@cutterscrossing.com] Sent: Monday, November 25, 2013 12:34 PM To: cf-talk Subject: Re: Application.cfc question to get the application.cfc in the subfolder to run, then your original request would have to be to the subfolder. CF bases which application.cfc to fire upon the originating request, then travels up the tree til it finds one (not down, as you are trying to do) Steve 'Cutter' Blades Adobe Community Professional Adobe Certified Expert Advanced Macromedia ColdFusion MX 7 Developer http://cutterscrossing.com Co-Author Learning Ext JS 3.2 Packt Publishing 2010 https://www.packtpub.com/learning-ext-js-3-2-for-building-dynamic-desktop-st yle-user-interfaces/book The best way to predict the future is to help create it On 11/25/2013 12:30 PM, Eric Roberts wrote: Here's the background... We have all of our requests going through the index.cfm in the root and depending on variable values, they get directed, via cfincludes, to subfolders. My question is how do I get the application.cfc in the subfolder to run? The application.cfc in the root is getting run, but it appears that the one in the subfolder is not. Each sub-folder contains a separate application with a unique name and the application.cfc has application specific variables in it. The application.cfc in the subfolder is set to extend the one in the root. Eric ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357132 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Application.cfc question
Short answer is, its difficult if you want to inherit the methods of the root folder Application.cfc. Coldfusion allows for one Application.cfc to extend another, but only if the inherited Application.cfc isnt in the root directory of the site or has a mapping in the CF Admin ( i.e. -you cant use extends=Application.cfc) or it throws an error, thinking its calling itself. That said, you can either create a mapping, make your inherited Application.cfc part of a subdirectory so CF doesnt get confused or use inheritance from another component, along with the SUPER scope to do what you want to do. Ben Nadel has a nice tutorial on the subject: http://www.bennadel.com/blog/1179-Ask-Ben-Extending-Application-cfc-And-OnRequestStart-With-SUPER.htm HTH, Jon On Nov 25, 2013, at 1:30 PM, Eric Roberts ow...@threeravensconsulting.com wrote: Here's the background... We have all of our requests going through the index.cfm in the root and depending on variable values, they get directed, via cfincludes, to subfolders. My question is how do I get the application.cfc in the subfolder to run? The application.cfc in the root is getting run, but it appears that the one in the subfolder is not. Each sub-folder contains a separate application with a unique name and the application.cfc has application specific variables in it. The application.cfc in the subfolder is set to extend the one in the root. Eric ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357133 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Application.cfc question
could you not have 1 application.cfc which simply calls different methods/includes according to the path in the URL. I have never tried it, and it would be bad practice and only a temp solution (others will swear for my suggesting this), but perhaps a quick fix would be to have the root application.cfc include a child application.cfc. or in your OnRequestStart, you test the URL and include a settings file from required sub-dir in the URL path, if the path has changed, reload the application. On Mon, Nov 25, 2013 at 6:45 PM, Eric Roberts ow...@threeravensconsulting.com wrote: That is what I was afraid of ;-) Thanks Steve! -Original Message- From: Steve 'Cutter' Blades [mailto:cold.fus...@cutterscrossing.com] Sent: Monday, November 25, 2013 12:34 PM To: cf-talk Subject: Re: Application.cfc question to get the application.cfc in the subfolder to run, then your original request would have to be to the subfolder. CF bases which application.cfc to fire upon the originating request, then travels up the tree til it finds one (not down, as you are trying to do) Steve 'Cutter' Blades Adobe Community Professional Adobe Certified Expert Advanced Macromedia ColdFusion MX 7 Developer http://cutterscrossing.com Co-Author Learning Ext JS 3.2 Packt Publishing 2010 https://www.packtpub.com/learning-ext-js-3-2-for-building-dynamic-desktop-st yle-user-interfaces/book The best way to predict the future is to help create it On 11/25/2013 12:30 PM, Eric Roberts wrote: Here's the background... We have all of our requests going through the index.cfm in the root and depending on variable values, they get directed, via cfincludes, to subfolders. My question is how do I get the application.cfc in the subfolder to run? The application.cfc in the root is getting run, but it appears that the one in the subfolder is not. Each sub-folder contains a separate application with a unique name and the application.cfc has application specific variables in it. The application.cfc in the subfolder is set to extend the one in the root. Eric ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357134 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Application.cfc question
If the purpose is code reuse, another possibility might be putting all logic into templates or other cfc. Then have both application.cfc call the required functionality through includes or method calls. Somewhat like a shared library. Byron Mann Lead Engineer Architect HostMySite.com On Nov 25, 2013 1:31 PM, Eric Roberts ow...@threeravensconsulting.com wrote: Here's the background... We have all of our requests going through the index.cfm in the root and depending on variable values, they get directed, via cfincludes, to subfolders. My question is how do I get the application.cfc in the subfolder to run? The application.cfc in the root is getting run, but it appears that the one in the subfolder is not. Each sub-folder contains a separate application with a unique name and the application.cfc has application specific variables in it. The application.cfc in the subfolder is set to extend the one in the root. Eric ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357135 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Application.cfc OnErrorRequest
I have the following for OnError. Live mode (application.setlocal eq 0) works perfectly. It's the ELSE that's not working. In the else I want it to show robust error messaging... but I'm getting a blank screen. The onError() method is catching the error for you, so if you want ColdFusion to re-throw the exception, try the cfrethrow tag to have it raise the exception again. -Justi ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:347592 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Application.cfc OnErrorRequest
Using cftrycfcatch type=Anycfrethrow/cfcatch/cftry Still gives me a blank page with no error information. Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged -Original Message- From: Justin Scott [mailto:leviat...@darktech.org] Sent: Thursday, September 22, 2011 11:24 AM To: cf-talk Subject: Re: Application.cfc OnErrorRequest I have the following for OnError. Live mode (application.setlocal eq 0) works perfectly. It's the ELSE that's not working. In the else I want it to show robust error messaging... but I'm getting a blank screen. The onError() method is catching the error for you, so if you want ColdFusion to re-throw the exception, try the cfrethrow tag to have it raise the exception again. -Justi ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:347593 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Application.cfc OnErrorRequest
Found it... In spite of Adobe's documentation which says: This method does not return a value; do not use the cfreturn tag. (http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=AppEvents_06.html) Adding cfreturn false / Now this (below) works as expected: cffunction name=OnError access=public returntype=void output=true hint=Fires when an exception occures that is not caught by a try/catch. cfif application.setlocal eq 0 cferror template=error_handler.cfm type=exception cfreturn false / cfelse cftrycfcatch type=Anycfrethrow/cfcatch/cftry cfreturn false / /cfif /cffunction Thanks Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:347594 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Application.cfc execution order
Sounds like either a) and error is occurring in onApplicationStart() or b) you didn;t reinitialize your app and onApplicationStart isn;t running since the app already exists. nic On 2/11/11 3:49 PM, Mike P mike...@optonline.net wrote: I recently modified my Application.cfc to email all errors for debugging. While sending the error, I referenced some email settings I saved in the application scope. It was my understanding that OnApplicationStart() fired before anything else, but it looks like ColdFusion is trying to parse OnError() first. Since the application variables are set in the OnApplicationStart() function, my app errors out. Is this the order the functions are supposed to execute in or should I be looking for something else that might be wrong? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342151 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Application.cfc execution order
Weird. It didn't work when I manually called OnApplicationStart, but it worked when i restarted the server. Sounds like either a) and error is occurring in onApplicationStart() or b) you didn;t reinitialize your app and onApplicationStart isn;t running since the app already exists. nic On 2/11/11 3:49 PM, Mike P mike...@optonline.net wrote: ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342152 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Application.cfc cfinclude
Hi Folks - I am feeling dumb and either I am missing something simple or it's way above me. In my application.cfc, I was going to have a cfinclude that would pull in my DB Name, user name, and password. I would store those variables in application scope in onApplicationStart(). Then reference them from there. But I pass them into data access cfc objects in my init()'s in onApplicationStart(), and save to variables in the data access cfc. Then in your queries, it'll look like cfquery datasource=#variables.dsn# That's just how I do it. I don't know about others. Will ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:341611 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Application.cfc cfinclude
Doug, can u show us the code in the include so we can see how you are storing/referencing the username/password. Russ On Thu, Jan 27, 2011 at 10:49 PM, Doug Ford doug.e.f...@gmail.com wrote: Hi Folks - I am feeling dumb and either I am missing something simple or it's way above me. In my application.cfc, I was going to have a cfinclude that would pull in my DB Name, user name, and password. But when I execute the index.cfm page, and dump my session variables, those pieces of info are not being included. I have moved the cfinclude all around from the beginning of the file to OnApplicationStart, OnSessionStart and nothing seems to work. Am I missing something? Thanks, Doug ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:341576 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Application.cfc cfinclude
Hey Doug, 1. How many lines of code are in the include? I'm just wondering because it might be easiest to simply move your code into the Application.CFC 2. How are you setting these vars in the include? Can you give us a sample of that code? 3. Once you moved the code around and into the onApplicationStart method, dod you rename the Application scope to force it to reload that method? =] -- Alan Rother Manager, Phoenix Cold Fusion User Group, www.AZCFUG.org Twitter: @AlanRother ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:341577 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Application.cfc cfinclude
can't you just do cfset onApplicationStart() / to get the method to fire? Do you really need to rename the app scope? On Thu, Jan 27, 2011 at 6:03 PM, Alan Rother alan.rot...@gmail.com wrote: Hey Doug, 1. How many lines of code are in the include? I'm just wondering because it might be easiest to simply move your code into the Application.CFC 2. How are you setting these vars in the include? Can you give us a sample of that code? 3. Once you moved the code around and into the onApplicationStart method, dod you rename the Application scope to force it to reload that method? =] -- Alan Rother Manager, Phoenix Cold Fusion User Group, www.AZCFUG.org Twitter: @AlanRother ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:341579 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Application.cfc cfinclude
On 1/27/2011 3:12 PM, Michael Grant wrote: can't you just docfset onApplicationStart() / to get the method to fire? Do you really need to rename the app scope? Yes, you can /fire/ the method that way. But that is OFTEN not exactly the same as triggering the onApplicaitonStart *event*. Sometimes one just really wants to experience the true event trigger. You can do this relatively simply by renaming the application name value OR setting the application timeout value to 0. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:341582 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Application.cfc cfinclude
Ah, I didn't know that. On Thu, Jan 27, 2011 at 6:27 PM, Ian Skinner h...@ilsweb.com wrote: On 1/27/2011 3:12 PM, Michael Grant wrote: can't you just docfset onApplicationStart() / to get the method to fire? Do you really need to rename the app scope? Yes, you can /fire/ the method that way. But that is OFTEN not exactly the same as triggering the onApplicaitonStart *event*. Sometimes one just really wants to experience the true event trigger. You can do this relatively simply by renaming the application name value OR setting the application timeout value to 0. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:341584 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Application.cfc cfinclude
Yeah, I was trying to get to the idea that he needed to somehow clear the app scope and force it to re-init those vars. I should have been clearer about that. =] On Thu, Jan 27, 2011 at 4:12 PM, Michael Grant mgr...@modus.bz wrote: can't you just do cfset onApplicationStart() / to get the method to fire? Do you really need to rename the app scope? On Thu, Jan 27, 2011 at 6:03 PM, Alan Rother alan.rot...@gmail.com wrote: Hey Doug, 1. How many lines of code are in the include? I'm just wondering because it might be easiest to simply move your code into the Application.CFC 2. How are you setting these vars in the include? Can you give us a sample of that code? 3. Once you moved the code around and into the onApplicationStart method, dod you rename the Application scope to force it to reload that method? =] -- Alan Rother Manager, Phoenix Cold Fusion User Group, www.AZCFUG.org Twitter: @AlanRother ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:341585 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Application.cfc cfinclude
can't you just docfset onApplicationStart() / to get the method to fire? Do you really need to rename the app scope? Yes, you can /fire/ the method that way. But that is OFTEN not exactly the same as triggering the onApplicaitonStart *event*. Sometimes one just really wants to experience the true event trigger. As far as I'm aware, the only way it's different is that it's not guaranteed to be thread-safe when you call it yourself. In all other respects, it's the same, and I'd recommend Michael's approach during development. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsi ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:341595 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: application.cfc
Chad Gray wrote: I can't put it in application.cfc. What not? That is the *good* way to include it in every file. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328630 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: application.cfc
A quick and clean way is to create a cfc named 'utils', 'udfs' or 'helpers' or somesuch. In that, place your MyDecimalFormat function, along with any other udfs you may have. Then, in application.cfc: cffunction name=onApplicationStart cfset application.udfs = CreateObject('component', 'path.to.my.udfs'); /cffunction Then, when you need it: #application.udfs.MyDecimalFormat(myNum)# You could also do something like 'variables.udfs = application.udfs;' in OnRequestStart() to make things less verbose when using your udfs, i.e. you could then do: #udfs.MyDecimalFormat(myNum)# HTH Dominic 2009/11/23 Chad Gray cg...@careyweb.com Is there any good way to have a function like this included in all pages? I can't put it in application.cfc. cfscript function MyDecimalFormat(some_value) { // call DecimalFormat to handle rounding, then strip out commas return Replace(DecimalFormat(some_value)ALL); } /cfscript ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328631 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: application.cfc
yep. Exactly how I do it. application.cfc = createObject(component,cfc); application.cfc.MyDecimalFormat('1234567'); ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328632 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: application.cfc
Ah.. makes sense! I should have thought of that. Thanks! Chad -Original Message- From: Dominic Watson [mailto:watson.domi...@googlemail.com] Sent: Monday, November 23, 2009 5:12 PM To: cf-talk Subject: Re: application.cfc A quick and clean way is to create a cfc named 'utils', 'udfs' or 'helpers' or somesuch. In that, place your MyDecimalFormat function, along with any other udfs you may have. Then, in application.cfc: cffunction name=onApplicationStart cfset application.udfs = CreateObject('component', 'path.to.my.udfs'); /cffunction Then, when you need it: #application.udfs.MyDecimalFormat(myNum)# You could also do something like 'variables.udfs = application.udfs;' in OnRequestStart() to make things less verbose when using your udfs, i.e. you could then do: #udfs.MyDecimalFormat(myNum)# HTH Dominic 2009/11/23 Chad Gray cg...@careyweb.com Is there any good way to have a function like this included in all pages? I can't put it in application.cfc. cfscript function MyDecimalFormat(some_value) { // call DecimalFormat to handle rounding, then strip out commas return Replace(DecimalFormat(some_value)ALL); } /cfscript ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328633 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: application.cfc for security
Not if the files being uploaded are things like images, or text files. Requests for those file types aren't routed through ColdFusion. Instead the webserver hands the files directly back to the user. Options: 1) Store the files outside of the webroot and only allow programmatic access via cfcontent which allows you do check session security (best for security) 2) Associate all files with ColdFusion and write a custom servlet filter to intercept these. (NOT recommend) 3) Enforce security at the web server with .htaccess or equivalent. This would NOT have access to your ColdFusion session scope, but rather would be a separate list of user names and passwords you could administer to control how could access that directory. ~Brad Original Message Subject: application.cfc for security From: Robert Harrison rob...@austin-williams.com Date: Fri, October 09, 2009 1:33 pm To: cf-talk cf-talk@houseoffusion.com I have a situation where is a user is creating subdirectories in a directory that I know. He's also uploading files via FTP. I know the name of the root directory, but don't necessarily know the name of the subdirectories and files. Is there any way I can put an application.cfc in the root directory so it would do a redirect on anyone who does not have the right credentials (e.g., a session variable)? I know I can make it work on all the .cfm files in the subs... but is there a way I can I make it work for all files? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327075 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: application.cfc for security
first of all, users should not be able to upload files below the web root. that is a dangerous thing to offer to them. What are you defining as right credentials? If a user can create directories and upload files using some ftp client then there are a number of things you can do to make sure each user gets his own area for file management and restrict access to other files. Can you elaborate your process? On Fri, Oct 9, 2009 at 11:33 AM, Robert Harrison rob...@austin-williams.com wrote: I have a situation where is a user is creating subdirectories in a directory that I know. He's also uploading files via FTP. I know the name of the root directory, but don't necessarily know the name of the subdirectories and files. Is there any way I can put an application.cfc in the root directory so it would do a redirect on anyone who does not have the right credentials (e.g., a session variable)? I know I can make it work on all the .cfm files in the subs... but is there a way I can I make it work for all files? Thanks Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged __ Information from ESET Smart Security, version of virus signature database 4494 (20091009) __ The message was checked by ESET Smart Security. http://www.eset.com ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327076 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: application.cfc for security
This is what I thought. Option 3 sounds the most realistic. Still, another project with scope creep and no budget increase. Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged -Original Message- From: b...@bradwood.com [mailto:b...@bradwood.com] Sent: Friday, October 09, 2009 2:45 PM To: cf-talk Subject: RE: application.cfc for security Not if the files being uploaded are things like images, or text files. Requests for those file types aren't routed through ColdFusion. Instead the webserver hands the files directly back to the user. Options: 1) Store the files outside of the webroot and only allow programmatic access via cfcontent which allows you do check session security (best for security) 2) Associate all files with ColdFusion and write a custom servlet filter to intercept these. (NOT recommend) 3) Enforce security at the web server with .htaccess or equivalent. This would NOT have access to your ColdFusion session scope, but rather would be a separate list of user names and passwords you could administer to control how could access that directory. ~Brad Original Message Subject: application.cfc for security From: Robert Harrison rob...@austin-williams.com Date: Fri, October 09, 2009 1:33 pm To: cf-talk cf-talk@houseoffusion.com I have a situation where is a user is creating subdirectories in a directory that I know. He's also uploading files via FTP. I know the name of the root directory, but don't necessarily know the name of the subdirectories and files. Is there any way I can put an application.cfc in the root directory so it would do a redirect on anyone who does not have the right credentials (e.g., a session variable)? I know I can make it work on all the .cfm files in the subs... but is there a way I can I make it work for all files? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327077 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: application.cfc for security
I've never allowed ftp access to my apps, but I do allow file uploads of images and such through file managers built into the app session scope includes a #session.homedir# value unique to each user.. when they upload a file (i use cffm) it lands in their home directory, and can then be referenced: img src=#member.homedir#\#request.imagename# or img src=#application.dsp.getProfileImage(memberid)# This setup silos uploads into discrete directories for individuals, but all of the uploaded images are publicly accessible in this implementation. On Fri, Oct 9, 2009 at 2:59 PM, Robert Harrison rob...@austin-williams.comwrote: This is what I thought. Option 3 sounds the most realistic. Still, another project with scope creep and no budget increase. Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged -Original Message- From: b...@bradwood.com [mailto:b...@bradwood.com] Sent: Friday, October 09, 2009 2:45 PM To: cf-talk Subject: RE: application.cfc for security Not if the files being uploaded are things like images, or text files. Requests for those file types aren't routed through ColdFusion. Instead the webserver hands the files directly back to the user. Options: 1) Store the files outside of the webroot and only allow programmatic access via cfcontent which allows you do check session security (best for security) 2) Associate all files with ColdFusion and write a custom servlet filter to intercept these. (NOT recommend) 3) Enforce security at the web server with .htaccess or equivalent. This would NOT have access to your ColdFusion session scope, but rather would be a separate list of user names and passwords you could administer to control how could access that directory. ~Brad Original Message Subject: application.cfc for security From: Robert Harrison rob...@austin-williams.com Date: Fri, October 09, 2009 1:33 pm To: cf-talk cf-talk@houseoffusion.com I have a situation where is a user is creating subdirectories in a directory that I know. He's also uploading files via FTP. I know the name of the root directory, but don't necessarily know the name of the subdirectories and files. Is there any way I can put an application.cfc in the root directory so it would do a redirect on anyone who does not have the right credentials (e.g., a session variable)? I know I can make it work on all the .cfm files in the subs... but is there a way I can I make it work for all files? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327078 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: application.cfc
id put it in an email rather than displaying, that way you knnow someone who isnt supps to see it is seeing it. but thats just me. On Mon, Apr 20, 2009 at 12:56 PM, Chad Gray cg...@careyweb.com wrote: Is it safe to put this code in the onError function? FORM Variablesbr / cfif isdefined(FORM.FieldNames)cfdump var=#FORM#/cfif SESSION Variablesbr cfif isdefined(session)cfdump var=#session#/cfif ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321813 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: application.cfc subdirectories and links
Liz, This is not a great solution, but you could put a dynamic Base tag in the head: Main directory: base href=./ / Sub directory: base href=../ / I think that would work as a stop-gap. -- Ben Nadel Adobe Community Expert Adobe Certified Advanced ColdFusion Developer Manager New York ColdFusion User Group http://www.bennadel.com Need ColdFusion Help? http://www.bennadel.com/Ask-Ben ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321776 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: application.cfc subdirectories and links
Create a mapping to the siteroot, and do cfinclude template=/siterootmapping/afile.cfm/ ? ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321777 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: application.cfc subdirectories and links
IMO, your best option is going to be setting your header, footer, etc. links to absolute paths. Meaning if your application root is www.mysite.com, then all of your primary links need to point to /aboutUs.cfm. The ensures that no matter how deep you are in the site, that link will always point to www.mysite.com/aboutUs.cfm. Most every other option is going to involve parsing the URL and figuring out where you are relative to your root and that's going to be more of a pain than resetting all those links. If you want, you can set an application variable as a placeholder for your application roor, i.e. cfset application.siteRoot = /. Then all of your links will look like [a href=#application.siteRoot#/aboutUs.cfm]About Us[/a} If your site root changes, just update the application variable. HTH, Adrian I have used the Application.cfc onRequestStart and onRequestEnd for the layout of my site, i.e. common header, mainnavigation and footer on all pages. Now the problem comes in where I have some files in a subdirectory: (The application.cfc is only in the root directory) the main navigation (siteroot\mainnav.cfm) is included in the application.cfc onRequestStart, but if this is called from the siteroot\subdir\somefile.cfm the links points to (e.g.) siteroot\subdir\aboutUs.cfm instead of siteroot\aboutUs.cfm Is there a way I can reference the links relative to the included template (siteroot\mainnav.cfm) instead of relative to the page I am on? I don't want to use absolute links, because that is a lot of links I will have to go and update... Thanks! ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321778 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Application.cfc error
Hi Laura, I'm getting this same error. Did you manage to fix this error? Do you remember what the problem was and if so can you kindly share it with me? Regards, John I'm getting an odd error when I try to use Application.cfc instead of Application.cfm. I get the following error: 500 ROOT CAUSE: java.lang.NoClassDefFoundError: Could not initialize class coldfusion. xml.rpc.CFCServlet at coldfusion.cfc.CFCProxy.init(CFCProxy.java:71) at coldfusion.runtime.AppEventInvoker.init(AppEventInvoker. java:47) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter. java:148) ... Any idea what could be causing it? I get the same error no matter if there is code in the cfc or not. Could I have messed up something in my jvm.config file when I was trying to get the debugging set up? Any help is appreciated. Thanks, Laura ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318399 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Application.cfc - normal request or web service?
|On Fri, Nov 28, 2008 at 10:59 AM, Hugo Ahlenius wrote: | Is there any way that the processing (e.g. OnRequestStart) |can know about the request to figure out if it is a web |service call (calling a component as a web service) or a |normal/plain .cfm request? I guess one can always parse this |from the CGI path variables - just curious if anyone knew |about any more clean way... |IsSOAPRequest(): |http://livedocs.adobe.com/coldfusion/8/htmldocs/functions_in-k_ |32.html#5052211 Thanks Jochem and others, It was something like that I was looking for - but why does it return no when I do a http:/host/testobject.cfc?method=testfunction request through the browser... ? (CFMX8) Cheers, Hugo ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316050 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Application.cfc - normal request or web service?
because http:/host/testobject.cfc?method=testfunction request is NOT invoking a web service. Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/ Hugo Ahlenius wrote: |On Fri, Nov 28, 2008 at 10:59 AM, Hugo Ahlenius wrote: | Is there any way that the processing (e.g. OnRequestStart) |can know about the request to figure out if it is a web |service call (calling a component as a web service) or a |normal/plain .cfm request? I guess one can always parse this |from the CGI path variables - just curious if anyone knew |about any more clean way... |IsSOAPRequest(): |http://livedocs.adobe.com/coldfusion/8/htmldocs/functions_in-k_ |32.html#5052211 Thanks Jochem and others, It was something like that I was looking for - but why does it return no when I do a http:/host/testobject.cfc?method=testfunction request through the browser... ? (CFMX8) Cheers, Hugo ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316051 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Application.cfc - normal request or web service?
On Fri, Nov 28, 2008 at 10:59 AM, Hugo Ahlenius wrote: Is there any way that the processing (e.g. OnRequestStart) can know about the request to figure out if it is a web service call (calling a component as a web service) or a normal/plain .cfm request? I guess one can always parse this from the CGI path variables - just curious if anyone knew about any more clean way... IsSOAPRequest(): http://livedocs.adobe.com/coldfusion/8/htmldocs/functions_in-k_32.html#5052211 Jochem ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316030 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Application.cfc - normal request or web service?
This will only return true for web service calls to be clear there are other ways of calling a CFC via HTTP that this will return false, AMF for example (which Mark was just showing me last night this lovely example). Fusebox just looks at the extension in the target page in OnRequestStart: !--- ensure CFC / Web Service / Flex Remoting calls are not intercepted --- cfif right(arguments.targetPage,4) is .cfc cfset doCompile = false / cfset structDelete(variables,onRequest) / cfset structDelete(this,onRequest) / /cfif Adam On Fri, Nov 28, 2008 at 5:52 PM, Jochem van Dieten [EMAIL PROTECTED]wrote: On Fri, Nov 28, 2008 at 10:59 AM, Hugo Ahlenius wrote: Is there any way that the processing (e.g. OnRequestStart) can know about the request to figure out if it is a web service call (calling a component as a web service) or a normal/plain .cfm request? I guess one can always parse this from the CGI path variables - just curious if anyone knew about any more clean way... IsSOAPRequest(): http://livedocs.adobe.com/coldfusion/8/htmldocs/functions_in-k_32.html#5052211 Jochem ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316035 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Application.cfc - normal request or web service?
On Fri, Nov 28, 2008 at 10:59 AM, Hugo Ahlenius wrote: Is there any way that the processing (e.g. OnRequestStart) can know about the request to figure out if it is a web service call (calling a component as a web service) or a normal/plain .cfm request? I guess one can always parse this from the CGI path variables - just curious if anyone knew about any more clean way... IsSOAPRequest(): http://livedocs.adobe.com/coldfusion/8/htmldocs/functions_in-k_32.html#5052211 Works if called inside the webservice CFC ... unfortunately doesn't work if called from outside the CFC, such as in the onRequestStart. Not sure what Hugo's use case is. -- s. isaac dealey ^ new epoch isn't it time for a change? ph: 781.769.0723 http://onTap.riaforge.org/blog ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316036 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Application.cfc question
Just curious: can anyone tell a bit more on how exactly Application.cfc is executed? With normal cfc's I believe that the code above the first method runs only when a new instance of the cfc is created, or when the cfc is invoked as a static component. It seems a bit strange to me that the cfif isDefined(url.reloadConfig) AND (isBoolean(url.reloadConfig) AND url.reloadConfig) cfset onApplicationStart() /cfif cfif isDefined(url.reloadSession) AND (isBoolean(url.reloadSession) AND url.reloadSession) cfset onSessionStart() /cfif are even executed. Does this mean that a new instance of Application.cfc is created for every request, or that it is invoked statically? I would have expected that one instance is shared across requests within an application. Martijn van der Woud Move both cfif blocks to the onRequestStart() method so they run a little bit later. Jochem ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315836 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Application.cfc question
I don't know the exact, internal details, but application.cfc is called on each request and knows ONLY about the current request. Other than putting data into scopes such as application, sesssion or server, nothing is kept from one request to another, within application.cfc. In this respect, application.cfc is the same as application.cfm. Mike _ From: Martijn van der Woud [mailto:[EMAIL PROTECTED] Sent: Mon 11/24/2008 1:31 PM To: cf-talk Subject: Re: Application.cfc question Just curious: can anyone tell a bit more on how exactly Application.cfc is executed? With normal cfc's I believe that the code above the first method runs only when a new instance of the cfc is created, or when the cfc is invoked as a static component. It seems a bit strange to me that the cfif isDefined(url.reloadConfig) AND (isBoolean(url.reloadConfig) AND url.reloadConfig) cfset onApplicationStart() /cfif cfif isDefined(url.reloadSession) AND (isBoolean(url.reloadSession) AND url.reloadSession) cfset onSessionStart() /cfif are even executed. Does this mean that a new instance of Application.cfc is created for every request, or that it is invoked statically? I would have expected that one instance is shared across requests within an application. Martijn van der Woud Move both cfif blocks to the onRequestStart() method so they run a little bit later. Jochem ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315858 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Application.cfc question
A new instance of Application.cfc is created and used on each request, which is why the code above the first method runs each time. mxAjax / CFAjax docs and other useful articles: http://www.bifrost.com.au/blog/ 2008/11/25 Martijn van der Woud [EMAIL PROTECTED]: Just curious: can anyone tell a bit more on how exactly Application.cfc is executed? With normal cfc's I believe that the code above the first method runs only when a new instance of the cfc is created, or when the cfc is invoked as a static component. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315864 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Application.cfc question
On Sat, Nov 22, 2008 at 8:38 AM, Dave Phillips wrote: I have the following code. When I try to execute my URL with the reloadConfig=yes parameter, The app fails on the first line of the onSessionStart() function with 'application.datasource does not exist.' Since onSessionStart is called AFTER onApplicationStart(), clearly, the cfsets that set application.datasource occur before that line of code. Any ideas? cfcomponent output=false cfset this.name = zarts_tag_prod cfset this.SessionManagement = true cfset this.sessionTimeout = createTimeSpan(7,0,0,0) cfset this.ApplicationTimeout = createTimeSpan(30,0,0,0) cfif isDefined(url.reloadConfig) AND (isBoolean(url.reloadConfig) AND url.reloadConfig) cfset onApplicationStart() /cfif cfif isDefined(url.reloadSession) AND (isBoolean(url.reloadSession) AND url.reloadSession) cfset onSessionStart() /cfif Move both cfif blocks to the onRequestStart() method so they run a little bit later. Jochem ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315802 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Application.cfc question
I ran into the same problem. I assign datasource in the application.cfm and then lose the connection string in the cfc. I believe the problem is that a cfc is intended to run in a different machine as thought it were a web service. As a result Cold Fusion does not carry the application state across the boundary even if it is on the same machine. It may be in a different process or a different thread. I do not know the cf internals well enough to know exactly why. That being said, I defined a datasource variable in the cfc and all went well. The other way to do it is to pass the application.datasource variable across as a function variable. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315810 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: application.cfc error
Are you sure your not clearing the cart outside of your application.cfc? -e On Mon, Nov 17, 2008 at 12:19 PM, Chad Gray [EMAIL PROTECTED] wrote: I don't understand what is happening. Anyone see something in my application.cfc that would cause this error? I can get rid of the error by reinitialing the application. I get this error every once in a while. It is like the application is not re-initialzing right and my application variables are lost when a user hits the web site and tries to use the application.cart variable. The application.page variable works fine. It display the pages etc. Error Info: Message: Element CART is undefined in a Java object of type class [Ljava.lang.String; referenced as Detail: Root Cause: Type: Expression Template: /act_addCartItem.cfm? Tag Context: Here is my application.cfc cfcomponent cfset this.name = testSite cfset this.sessionManagement = true cffunction name=onApplicationStart cfset application.dsn = datasource1 cfset application.page = createObject(component, com.testSite.pages) cfset application.cart = createObject(component, com.testSite.cart) cfreturn true /cffunction cffunction name=onRequestStart cfargument name=thePage type=string required=true cfif isdefined(URL.reinit) cfset onApplicationStart() / /cfif /cffunction cffunction name=onRequestEnd returnType=void output=false cfargument name=thePage type=string required=true cfset var cfid_local = cfset var cftoken_local = !--- if the user closes their browser, make sure all session variables get killed --- cfif isdefined(Cookie.CFID) and isdefined(Cookie.CFTOKEN) cfset cfid_local = cookie.cfid cfset cftoken_local = cookie.cftoken cfcookie name=CFID value=#cfid_local# cfcookie name=CFTOKEN value=#cftoken_local# /cfif /cffunction /cfcomponent ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315368 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: application.cfc error
Could it be that the application is timing out? What sort of traffic does the site get? What is your application timeout set to? -- Josh -Original Message- From: Chad Gray [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2008 9:20 AM To: cf-talk Subject: application.cfc error I don't understand what is happening. Anyone see something in my application.cfc that would cause this error? I can get rid of the error by reinitialing the application. I get this error every once in a while. It is like the application is not re-initialzing right and my application variables are lost when a user hits the web site and tries to use the application.cart variable. The application.page variable works fine. It display the pages etc. Error Info: Message: Element CART is undefined in a Java object of type class [Ljava.lang.String; referenced as Detail: Root Cause: Type: Expression Template: /act_addCartItem.cfm? Tag Context: Here is my application.cfc cfcomponent cfset this.name = testSite cfset this.sessionManagement = true cffunction name=onApplicationStart cfset application.dsn = datasource1 cfset application.page = createObject(component, com.testSite.pages) cfset application.cart = createObject(component, com.testSite.cart) cfreturn true /cffunction cffunction name=onRequestStart cfargument name=thePage type=string required=true cfif isdefined(URL.reinit) cfset onApplicationStart() / /cfif /cffunction cffunction name=onRequestEnd returnType=void output=false cfargument name=thePage type=string required=true cfset var cfid_local = cfset var cftoken_local = !--- if the user closes their browser, make sure all session variables get killed --- cfif isdefined(Cookie.CFID) and isdefined(Cookie.CFTOKEN) cfset cfid_local = cookie.cfid cfset cftoken_local = cookie.cftoken cfcookie name=CFID value=#cfid_local# cfcookie name=CFTOKEN value=#cftoken_local# /cfif /cffunction /cfcomponent ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315369 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: application.cfc error
Off hand I'm not sure what is causing it, but this may help cfif (isdefined(URL.reinit)) OR (NOT IsDefined(Application.Cart)) OR (NOT IsDefined(Application.Page)) cfset onApplicationStart() / /cfif =] -- Alan Rother Adobe Certified Advanced ColdFusion MX 7 Developer Manager, Phoenix Cold Fusion User Group, AZCFUG.org ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315370 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: application.cfc error
Ya positive. There are only about 10 pages total in the web site. So I know for sure there is no code to kill the variable. -Original Message- From: Emmet McGovern [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2008 12:43 PM To: cf-talk Subject: Re: application.cfc error Are you sure your not clearing the cart outside of your application.cfc? -e On Mon, Nov 17, 2008 at 12:19 PM, Chad Gray [EMAIL PROTECTED] wrote: I don't understand what is happening. Anyone see something in my application.cfc that would cause this error? I can get rid of the error by reinitialing the application. I get this error every once in a while. It is like the application is not re-initialzing right and my application variables are lost when a user hits the web site and tries to use the application.cart variable. The application.page variable works fine. It display the pages etc. Error Info: Message: Element CART is undefined in a Java object of type class [Ljava.lang.String; referenced as Detail: Root Cause: Type: Expression Template: /act_addCartItem.cfm? Tag Context: Here is my application.cfc cfcomponent cfset this.name = testSite cfset this.sessionManagement = true cffunction name=onApplicationStart cfset application.dsn = datasource1 cfset application.page = createObject(component, com.testSite.pages) cfset application.cart = createObject(component, com.testSite.cart) cfreturn true /cffunction cffunction name=onRequestStart cfargument name=thePage type=string required=true cfif isdefined(URL.reinit) cfset onApplicationStart() / /cfif /cffunction cffunction name=onRequestEnd returnType=void output=false cfargument name=thePage type=string required=true cfset var cfid_local = cfset var cftoken_local = !--- if the user closes their browser, make sure all session variables get killed --- cfif isdefined(Cookie.CFID) and isdefined(Cookie.CFTOKEN) cfset cfid_local = cookie.cfid cfset cftoken_local = cookie.cftoken cfcookie name=CFID value=#cfid_local# cfcookie name=CFTOKEN value=#cftoken_local# /cfif /cffunction /cfcomponent ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315371 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: application.cfc error
Traffic is minimal. We are just testing the site now. So it will sit for many days before getting another user. I would guess the default timeout on the application since I am not defining one in the application.cfc. 2 days in the administrator. Shouldn't the application start back up after timing out? I will add that I noticed another application variable timing out (that I took out of the application.cfc). I use to have an application.adminEmail defined just below the application.cart. And when I had a onError function in the application.cfc when the onError function fired it would say that the application.adminEmail is not defined. So it is like only the first two application variables (dsn, page) was any good. The rest were un-defined. -Original Message- From: Josh Nathanson [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2008 12:59 PM To: cf-talk Subject: RE: application.cfc error Could it be that the application is timing out? What sort of traffic does the site get? What is your application timeout set to? -- Josh -Original Message- From: Chad Gray [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2008 9:20 AM To: cf-talk Subject: application.cfc error I don't understand what is happening. Anyone see something in my application.cfc that would cause this error? I can get rid of the error by reinitialing the application. I get this error every once in a while. It is like the application is not re-initialzing right and my application variables are lost when a user hits the web site and tries to use the application.cart variable. The application.page variable works fine. It display the pages etc. Error Info: Message: Element CART is undefined in a Java object of type class [Ljava.lang.String; referenced as Detail: Root Cause: Type: Expression Template: /act_addCartItem.cfm? Tag Context: Here is my application.cfc cfcomponent cfset this.name = testSite cfset this.sessionManagement = true cffunction name=onApplicationStart cfset application.dsn = datasource1 cfset application.page = createObject(component, com.testSite.pages) cfset application.cart = createObject(component, com.testSite.cart) cfreturn true /cffunction cffunction name=onRequestStart cfargument name=thePage type=string required=true cfif isdefined(URL.reinit) cfset onApplicationStart() / /cfif /cffunction cffunction name=onRequestEnd returnType=void output=false cfargument name=thePage type=string required=true cfset var cfid_local = cfset var cftoken_local = !--- if the user closes their browser, make sure all session variables get killed --- cfif isdefined(Cookie.CFID) and isdefined(Cookie.CFTOKEN) cfset cfid_local = cookie.cfid cfset cftoken_local = cookie.cftoken cfcookie name=CFID value=#cfid_local# cfcookie name=CFTOKEN value=#cftoken_local# /cfif /cffunction /cfcomponent ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315373 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: application.cfc error
Seems like kind of a hack eh'? It probably would work though. -Original Message- From: Alan Rother [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2008 1:20 PM To: cf-talk Subject: Re: application.cfc error Off hand I'm not sure what is causing it, but this may help cfif (isdefined(URL.reinit)) OR (NOT IsDefined(Application.Cart)) OR (NOT IsDefined(Application.Page)) cfset onApplicationStart() / /cfif =] -- Alan Rother Adobe Certified Advanced ColdFusion MX 7 Developer Manager, Phoenix Cold Fusion User Group, AZCFUG.org ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315374 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: application.cfc error
Hey Chad, One more thing came to mind... Not knowing anything about your hosting setup this is a wild guess... But your Application scope could be getting corrupted by another site on the same server having the same Application name... cfset this.name = testSite As a practice, I try to make this value as unique as reasonable. cfset this.name = CustomerA1234_Build26_11142008 It's a theory anyhow... =] -- Alan Rother Adobe Certified Advanced ColdFusion MX 7 Developer Manager, Phoenix Cold Fusion User Group, AZCFUG.org ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315375 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: application.cfc error
Hmmm you know I did realize that there was another web site using the same application name. Could this cause my problems? -Original Message- From: Chad Gray [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2008 1:41 PM To: cf-talk Subject: RE: application.cfc error Traffic is minimal. We are just testing the site now. So it will sit for many days before getting another user. I would guess the default timeout on the application since I am not defining one in the application.cfc. 2 days in the administrator. Shouldn't the application start back up after timing out? I will add that I noticed another application variable timing out (that I took out of the application.cfc). I use to have an application.adminEmail defined just below the application.cart. And when I had a onError function in the application.cfc when the onError function fired it would say that the application.adminEmail is not defined. So it is like only the first two application variables (dsn, page) was any good. The rest were un-defined. -Original Message- From: Josh Nathanson [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2008 12:59 PM To: cf-talk Subject: RE: application.cfc error Could it be that the application is timing out? What sort of traffic does the site get? What is your application timeout set to? -- Josh -Original Message- From: Chad Gray [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2008 9:20 AM To: cf-talk Subject: application.cfc error I don't understand what is happening. Anyone see something in my application.cfc that would cause this error? I can get rid of the error by reinitialing the application. I get this error every once in a while. It is like the application is not re-initialzing right and my application variables are lost when a user hits the web site and tries to use the application.cart variable. The application.page variable works fine. It display the pages etc. Error Info: Message: Element CART is undefined in a Java object of type class [Ljava.lang.String; referenced as Detail: Root Cause: Type: Expression Template: /act_addCartItem.cfm? Tag Context: Here is my application.cfc cfcomponent cfset this.name = testSite cfset this.sessionManagement = true cffunction name=onApplicationStart cfset application.dsn = datasource1 cfset application.page = createObject(component, com.testSite.pages) cfset application.cart = createObject(component, com.testSite.cart) cfreturn true /cffunction cffunction name=onRequestStart cfargument name=thePage type=string required=true cfif isdefined(URL.reinit) cfset onApplicationStart() / /cfif /cffunction cffunction name=onRequestEnd returnType=void output=false cfargument name=thePage type=string required=true cfset var cfid_local = cfset var cftoken_local = !--- if the user closes their browser, make sure all session variables get killed --- cfif isdefined(Cookie.CFID) and isdefined(Cookie.CFTOKEN) cfset cfid_local = cookie.cfid cfset cftoken_local = cookie.cftoken cfcookie name=CFID value=#cfid_local# cfcookie name=CFTOKEN value=#cftoken_local# /cfif /cffunction /cfcomponent ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315376 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: application.cfc error
If this line ever errors on AppStart: cfset application.page = createObject(component, com.testSite.pages) The cart won't get created and the app will have started. Adrian Building a database of ColdFusion errors at http://cferror.org/ -Original Message- From: Chad Gray Sent: 17 November 2008 18:41 To: cf-talk Subject: RE: application.cfc error Seems like kind of a hack eh'? It probably would work though. -Original Message- From: Alan Rother Sent: Monday, November 17, 2008 1:20 PM To: cf-talk Subject: Re: application.cfc error Off hand I'm not sure what is causing it, but this may help cfif (isdefined(URL.reinit)) OR (NOT IsDefined(Application.Cart)) OR (NOT IsDefined(Application.Page)) cfset onApplicationStart() / /cfif =] -- Alan Rother ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315377 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: application.cfc error
Hmmm you know I did realize that there was another web site using the same application name. Could this cause my problems? YES -- Alan Rother Adobe Certified Advanced ColdFusion MX 7 Developer Manager, Phoenix Cold Fusion User Group, AZCFUG.org ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315378 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: application.cfc error
Use the following code to prevent issues with running multiple applications with the same name on a single server. this.name = constants.siteName { hash(getCurrentTemplatePath()) } (If I remembered where I first saw this, I would give proper credit.) Mike ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315380 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: application.cfc error
I bet this is the problem! I just looked at the other application.cfc on the web server and it is defining the same application name and only defining the first two application variables! cffunction name=onApplicationStart returnType=boolean output=false cfset application.dsn = datasource1 cfset application.page = createObject(component, com.testSite.pages) cfreturn true /cffunction Right? So now say someone hits testSite1 and it runs the above application. Now someone hits testSite2 and CF says Hey this application is already running, but not all of my applications variables are defined for testSite2. This is where I am getting my error! -Original Message- From: Chad Gray [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2008 1:42 PM To: cf-talk Subject: RE: application.cfc error Hmmm you know I did realize that there was another web site using the same application name. Could this cause my problems? -Original Message- From: Chad Gray [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2008 1:41 PM To: cf-talk Subject: RE: application.cfc error Traffic is minimal. We are just testing the site now. So it will sit for many days before getting another user. I would guess the default timeout on the application since I am not defining one in the application.cfc. 2 days in the administrator. Shouldn't the application start back up after timing out? I will add that I noticed another application variable timing out (that I took out of the application.cfc). I use to have an application.adminEmail defined just below the application.cart. And when I had a onError function in the application.cfc when the onError function fired it would say that the application.adminEmail is not defined. So it is like only the first two application variables (dsn, page) was any good. The rest were un-defined. -Original Message- From: Josh Nathanson [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2008 12:59 PM To: cf-talk Subject: RE: application.cfc error Could it be that the application is timing out? What sort of traffic does the site get? What is your application timeout set to? -- Josh -Original Message- From: Chad Gray [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2008 9:20 AM To: cf-talk Subject: application.cfc error I don't understand what is happening. Anyone see something in my application.cfc that would cause this error? I can get rid of the error by reinitialing the application. I get this error every once in a while. It is like the application is not re-initialzing right and my application variables are lost when a user hits the web site and tries to use the application.cart variable. The application.page variable works fine. It display the pages etc. Error Info: Message: Element CART is undefined in a Java object of type class [Ljava.lang.String; referenced as Detail: Root Cause: Type: Expression Template: /act_addCartItem.cfm? Tag Context: Here is my application.cfc cfcomponent cfset this.name = testSite cfset this.sessionManagement = true cffunction name=onApplicationStart cfset application.dsn = datasource1 cfset application.page = createObject(component, com.testSite.pages) cfset application.cart = createObject(component, com.testSite.cart) cfreturn true /cffunction cffunction name=onRequestStart cfargument name=thePage type=string required=true cfif isdefined(URL.reinit) cfset onApplicationStart() / /cfif /cffunction cffunction name=onRequestEnd returnType=void output=false cfargument name=thePage type=string required=true cfset var cfid_local = cfset var cftoken_local = !--- if the user closes their browser, make sure all session variables get killed --- cfif isdefined(Cookie.CFID) and isdefined(Cookie.CFTOKEN) cfset cfid_local = cookie.cfid cfset cftoken_local = cookie.cftoken cfcookie name=CFID value=#cfid_local# cfcookie name=CFTOKEN value=#cftoken_local# /cfif /cffunction /cfcomponent ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315379 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm
Re: application.cfc and session structure
If you are referring to something that will run in production as opposed to some limited debugging in a development environment, then I prefer dumping the error details to a database table or inside of an email. -Mike Chabot On Thu, Oct 23, 2008 at 9:27 AM, Chad Gray [EMAIL PROTECTED] wrote: What is the safest way to dump the session variables in the onError function of Application.cfc? Thanks Chad ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:314288 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: application.cfc and session structure
Right I want to email the session variables. Should I do an inDefined first to see if they exists? I don't want an error in my error function is what I am getting at. Chad -Original Message- From: Mike Chabot [mailto:[EMAIL PROTECTED] Sent: Thursday, October 23, 2008 9:50 AM To: cf-talk Subject: Re: application.cfc and session structure If you are referring to something that will run in production as opposed to some limited debugging in a development environment, then I prefer dumping the error details to a database table or inside of an email. -Mike Chabot On Thu, Oct 23, 2008 at 9:27 AM, Chad Gray [EMAIL PROTECTED] wrote: What is the safest way to dump the session variables in the onError function of Application.cfc? Thanks Chad ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:314297 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: application.cfc and session structure
Yes, you should use isdefined or try/catch to help prevent errors inside of your error handler. -Mike Chabot On Thu, Oct 23, 2008 at 11:22 AM, Chad Gray [EMAIL PROTECTED] wrote: Right I want to email the session variables. Should I do an inDefined first to see if they exists? I don't want an error in my error function is what I am getting at. Chad -Original Message- From: Mike Chabot [mailto:[EMAIL PROTECTED] Sent: Thursday, October 23, 2008 9:50 AM To: cf-talk Subject: Re: application.cfc and session structure If you are referring to something that will run in production as opposed to some limited debugging in a development environment, then I prefer dumping the error details to a database table or inside of an email. -Mike Chabot On Thu, Oct 23, 2008 at 9:27 AM, Chad Gray [EMAIL PROTECTED] wrote: What is the safest way to dump the session variables in the onError function of Application.cfc? Thanks Chad ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:314298 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Application.cfc OnSessionEnd
Scratch that question .. we found a small problem in the code .. it does run the components. Thought it should. -Original Message- From: Paul Giesenhagen [mailto:[EMAIL PROTECTED] Sent: Thursday, August 14, 2008 10:30 AM To: CF-Talk Subject: Application.cfc OnSessionEnd Can you call other components within the OnSessionEnd? If I call a query directly in the OnSessionEnd function it works fine .. but if I put that query into a component and call the component, it doesn't work. Any ideas? ~| 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:310981 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Application.cfc variables
the 'this' scope corresponds to the CFAPPLICATION tag, not the application scope. If you want to set stuff into the application scope you have to use it literally. A concrete example: setting this.name is equivalent to passing the NAME attribute to CFAPPLICATION, which in turn is available as the application.applicationname variable. cheers, barneyb On Tue, Jun 10, 2008 at 3:58 PM, Alex Pogodin [EMAIL PROTECTED] wrote: Hi everyone! Can somebody explain me why assigning a value to This.Blah inside Application.cfc doesn't affect Application struct itself. Doesn't Application.cfc represent an application scope? if so, why assigning this.name inside cfc affects Application. and one more related question: do I need to explicitly use Application scoping inside Application.cfc? Any info is very appreciated. Thanks in advance, Alex ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307210 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Application.cfc question: Where would be the best place to put this code?
That would be the most logical place to put it. I'm not sure that a cfabort is the best bet though. Why not simply use a regex and just strip out the offending portion of the query string? Start with http and remove that, and everything after it. -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2008 8:15 AM To: CF-Talk Subject: Application.cfc question: Where would be the best place to put this code? Losers are hammering my site with spam in the urls. The first line is what my url should look like. The second line is what I am getting from the spammers. http://www.mydomain.com/index.cfm?type=Specialtyspec=110 http://www.mydomain.com/index.cfm?type=Specialtyspec=http%3A%2F%2Fwww.north fans.ch%2Fforum%2Fadmin%2Fsettings%2Focoyo%2Fser%2F If I were to use the following code in Application.cfc, which function would be the best place to put it? Right now, I was thinking of placing it in onRequestStart. Any better ideas? The code would be simple an something like this: cfif cgi.query_string contains http://; cflocation url=http://www.mydomain.com; cfabort /cfif ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306952 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Application.cfc question: Where would be the best place to put this code?
OnRequestStart would seem to be a good place for it. You might also override the Session timeout (if you're using sessions) so that these spam requests don't create a large number of dead sessions. You can set the timeout to 5 seconds or something before you do the redirect. Regards, Brian On Fri, Jun 6, 2008 at 9:14 AM, Che Vilnonis [EMAIL PROTECTED] wrote: Losers are hammering my site with spam in the urls. The first line is what my url should look like. The second line is what I am getting from the spammers. http://www.mydomain.com/index.cfm?type=Specialtyspec=110 http://www.mydomain.com/index.cfm?type=Specialtyspec=http%3A%2F%2Fwww.north fans.ch%2Fforum%2Fadmin%2Fsettings%2Focoyo%2Fser%2F If I were to use the following code in Application.cfc, which function would be the best place to put it? Right now, I was thinking of placing it in onRequestStart. Any better ideas? The code would be simple an something like this: cfif cgi.query_string contains http://; cflocation url=http://www.mydomain.com; cfabort /cfif ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306953 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Application.cfc question: Where would be the best place to put this code?
Basically, I am trying to prevent auto generated 'error' emails from being sent to me 200+ times a day. What would the regex do? If I strip out the offending string, it will likely still be invalid and cause an error to be created. Good point on the cfabort though. Regards, Che -Original Message- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2008 9:17 AM To: CF-Talk Subject: RE: Application.cfc question: Where would be the best place to put this code? That would be the most logical place to put it. I'm not sure that a cfabort is the best bet though. Why not simply use a regex and just strip out the offending portion of the query string? Start with http and remove that, and everything after it. -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2008 8:15 AM To: CF-Talk Subject: Application.cfc question: Where would be the best place to put this code? Losers are hammering my site with spam in the urls. The first line is what my url should look like. The second line is what I am getting from the spammers. http://www.mydomain.com/index.cfm?type=Specialtyspec=110 http://www.mydomain.com/index.cfm?type=Specialtyspec=http%3A%2F%2Fwww.north fans.ch%2Fforum%2Fadmin%2Fsettings%2Focoyo%2Fser%2F If I were to use the following code in Application.cfc, which function would be the best place to put it? Right now, I was thinking of placing it in onRequestStart. Any better ideas? The code would be simple an something like this: cfif cgi.query_string contains http://; cflocation url=http://www.mydomain.com; cfabort /cfif ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306955 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Application.cfc question: Where would be the best place to put this code?
Brian, w/regards to resetting the session timeout, would this work? cfif cgi.query_string contains http://; cfset session.urltoken = cflocation url=http://www.mydomain.com; /cfif Regards, Che -Original Message- From: Brian Kotek [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2008 9:18 AM To: CF-Talk Subject: Re: Application.cfc question: Where would be the best place to put this code? OnRequestStart would seem to be a good place for it. You might also override the Session timeout (if you're using sessions) so that these spam requests don't create a large number of dead sessions. You can set the timeout to 5 seconds or something before you do the redirect. Regards, Brian On Fri, Jun 6, 2008 at 9:14 AM, Che Vilnonis [EMAIL PROTECTED] wrote: Losers are hammering my site with spam in the urls. The first line is what my url should look like. The second line is what I am getting from the spammers. http://www.mydomain.com/index.cfm?type=Specialtyspec=110 http://www.mydomain.com/index.cfm?type=Specialtyspec=http%3A%2F%2Fwww .north fans.ch%2Fforum%2Fadmin%2Fsettings%2Focoyo%2Fser%2F If I were to use the following code in Application.cfc, which function would be the best place to put it? Right now, I was thinking of placing it in onRequestStart. Any better ideas? The code would be simple an something like this: cfif cgi.query_string contains http://; cflocation url=http://www.mydomain.com; cfabort /cfif ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306956 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Application.cfc question: Where would be the best place to put this code?
Well, the spammers had to get your page from somewhere...the page is likely only invalid because they're tacking on extra query params right? So removing the offending params might allow a valid request to get through. Remember that it's always possible that a legitimate person could have clicked a spammed link to get to your site. Why kill that legit request when you don't have to? -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2008 8:24 AM To: CF-Talk Subject: RE: Application.cfc question: Where would be the best place to put this code? Basically, I am trying to prevent auto generated 'error' emails from being sent to me 200+ times a day. What would the regex do? If I strip out the offending string, it will likely still be invalid and cause an error to be created. Good point on the cfabort though. Regards, Che -Original Message- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2008 9:17 AM To: CF-Talk Subject: RE: Application.cfc question: Where would be the best place to put this code? That would be the most logical place to put it. I'm not sure that a cfabort is the best bet though. Why not simply use a regex and just strip out the offending portion of the query string? Start with http and remove that, and everything after it. -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2008 8:15 AM To: CF-Talk Subject: Application.cfc question: Where would be the best place to put this code? Losers are hammering my site with spam in the urls. The first line is what my url should look like. The second line is what I am getting from the spammers. http://www.mydomain.com/index.cfm?type=Specialtyspec=110 http://www.mydomain.com/index.cfm?type=Specialtyspec=http%3A%2F%2Fwww.north fans.ch%2Fforum%2Fadmin%2Fsettings%2Focoyo%2Fser%2F If I were to use the following code in Application.cfc, which function would be the best place to put it? Right now, I was thinking of placing it in onRequestStart. Any better ideas? The code would be simple an something like this: cfif cgi.query_string contains http://; cflocation url=http://www.mydomain.com; cfabort /cfif ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306958 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Application.cfc question: Where would be the best place to put this code?
OK. If I were to use a regex, should I still place the code in onRequestStart and use a re-direct with cflocation? -Original Message- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2008 9:44 AM To: CF-Talk Subject: RE: Application.cfc question: Where would be the best place to put this code? Well, the spammers had to get your page from somewhere...the page is likely only invalid because they're tacking on extra query params right? So removing the offending params might allow a valid request to get through. Remember that it's always possible that a legitimate person could have clicked a spammed link to get to your site. Why kill that legit request when you don't have to? -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2008 8:24 AM To: CF-Talk Subject: RE: Application.cfc question: Where would be the best place to put this code? Basically, I am trying to prevent auto generated 'error' emails from being sent to me 200+ times a day. What would the regex do? If I strip out the offending string, it will likely still be invalid and cause an error to be created. Good point on the cfabort though. Regards, Che ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306960 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Application.cfc question: Where would be the best place to put this code?
You could just set this.sessionTimeOut, but on further thought if you just redirect them to the home page then they'll just start a new session there. Maybe a better option (if you're sure these are spammers) is just to abort the request and be done with it? On Fri, Jun 6, 2008 at 9:30 AM, Che Vilnonis [EMAIL PROTECTED] wrote: Brian, w/regards to resetting the session timeout, would this work? cfif cgi.query_string contains http://; cfset session.urltoken = cflocation url=http://www.mydomain.com; /cfif Regards, Che -Original Message- From: Brian Kotek [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2008 9:18 AM To: CF-Talk Subject: Re: Application.cfc question: Where would be the best place to put this code? OnRequestStart would seem to be a good place for it. You might also override the Session timeout (if you're using sessions) so that these spam requests don't create a large number of dead sessions. You can set the timeout to 5 seconds or something before you do the redirect. Regards, Brian On Fri, Jun 6, 2008 at 9:14 AM, Che Vilnonis [EMAIL PROTECTED] wrote: Losers are hammering my site with spam in the urls. The first line is what my url should look like. The second line is what I am getting from the spammers. http://www.mydomain.com/index.cfm?type=Specialtyspec=110 http://www.mydomain.com/index.cfm?type=Specialtyspec=http%3A%2F%2Fwww .north fans.ch%2Fforum%2Fadmin%2Fsettings%2Focoyo%2Fser%2F If I were to use the following code in Application.cfc, which function would be the best place to put it? Right now, I was thinking of placing it in onRequestStart. Any better ideas? The code would be simple an something like this: cfif cgi.query_string contains http://; cflocation url=http://www.mydomain.com; cfabort /cfif ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306957 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Application.cfc question: Where would be the best place to put this code?
That makes sense to me. -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2008 8:54 AM To: CF-Talk Subject: RE: Application.cfc question: Where would be the best place to put this code? OK. If I were to use a regex, should I still place the code in onRequestStart and use a re-direct with cflocation? -Original Message- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2008 9:44 AM To: CF-Talk Subject: RE: Application.cfc question: Where would be the best place to put this code? Well, the spammers had to get your page from somewhere...the page is likely only invalid because they're tacking on extra query params right? So removing the offending params might allow a valid request to get through. Remember that it's always possible that a legitimate person could have clicked a spammed link to get to your site. Why kill that legit request when you don't have to? -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2008 8:24 AM To: CF-Talk Subject: RE: Application.cfc question: Where would be the best place to put this code? Basically, I am trying to prevent auto generated 'error' emails from being sent to me 200+ times a day. What would the regex do? If I strip out the offending string, it will likely still be invalid and cause an error to be created. Good point on the cfabort though. Regards, Che ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306962 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Application.cfc question: Where would be the best place to put this code?
OK. This is interesting. If I place the simple test code below in onRequestStart, I am *not* re-directed and I still get the error email and the error page displayed when a link like the one below is clicked. Why might this be happening? Is the error being processed first? onRequestStart always fires before onError, right? http://www.mydomain.com/index.cfm?type=selectModelmakeid=http%3A%2F%2Frabot nitsa.ru%2Fjoomla__%2Fadministrator%2Fbackups%2Farim%2Fzaf%2F cfif cgi.query_string contains http://; cflocation url=index.cfm /cfif -Original Message- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2008 9:58 AM To: CF-Talk Subject: RE: Application.cfc question: Where would be the best place to put this code? That makes sense to me. -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2008 8:54 AM To: CF-Talk Subject: RE: Application.cfc question: Where would be the best place to put this code? OK. If I were to use a regex, should I still place the code in onRequestStart and use a re-direct with cflocation? -Original Message- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2008 9:44 AM To: CF-Talk Subject: RE: Application.cfc question: Where would be the best place to put this code? Well, the spammers had to get your page from somewhere...the page is likely only invalid because they're tacking on extra query params right? So removing the offending params might allow a valid request to get through. Remember that it's always possible that a legitimate person could have clicked a spammed link to get to your site. Why kill that legit request when you don't have to? ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306963 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Application.cfc question: Where would be the best place to put this code?
Oops. Fixed it. Needed to add urldecode() to my conditional. -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2008 10:12 AM To: CF-Talk Subject: RE: Application.cfc question: Where would be the best place to put this code? OK. This is interesting. If I place the simple test code below in onRequestStart, I am *not* re-directed and I still get the error email and the error page displayed when a link like the one below is clicked. Why might this be happening? Is the error being processed first? onRequestStart always fires before onError, right? http://www.mydomain.com/index.cfm?type=selectModelmakeid=http%3A%2F%2Frabot nitsa.ru%2Fjoomla__%2Fadministrator%2Fbackups%2Farim%2Fzaf%2F cfif cgi.query_string contains http://; cflocation url=index.cfm /cfif -Original Message- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2008 9:58 AM To: CF-Talk Subject: RE: Application.cfc question: Where would be the best place to put this code? That makes sense to me. -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2008 8:54 AM To: CF-Talk Subject: RE: Application.cfc question: Where would be the best place to put this code? OK. If I were to use a regex, should I still place the code in onRequestStart and use a re-direct with cflocation? -Original Message- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2008 9:44 AM To: CF-Talk Subject: RE: Application.cfc question: Where would be the best place to put this code? Well, the spammers had to get your page from somewhere...the page is likely only invalid because they're tacking on extra query params right? So removing the offending params might allow a valid request to get through. Remember that it's always possible that a legitimate person could have clicked a spammed link to get to your site. Why kill that legit request when you don't have to? ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306967 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: application.cfc / cfthread / my complete lack of understanding
I've figured what I was doing wrong, so my corrected question is: is there any way to terminate a running thread that was launched by a PREVIOUS page request? ~| Get involved in the latest ColdFusion discussions, product development sharing, and articles on the Adobe Labs wiki. http://labs/adobe.com/wiki/index.php/ColdFusion_8 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290408 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Application.cfc adding whitespace
Use output=false on the component and all of the methods On 9/3/07, James Smith [EMAIL PROTECTED] wrote: I have a cfm page which must at all costs return a simple pipe delimited list with no whitespace before or after it. Application.cfc is adding some and messing everything up. For now I have fixed the problem by moving the relevant cfm page into its own folder with its own [blank] application.cfc but the has got to be a better long term solution. Anyone any ideas? -- Jay No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.484 / Virus Database: 269.13.2/985 - Release Date: 02/09/2007 16:32 ~| Get the answers you are looking for on the ColdFusion Labs Forum direct from active programmers and developers. http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72catid=648 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287655 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Application.cfc adding whitespace
Is output set to false? You can also use cfcontent reset=yes / just before any output in the calling page to reset any white space. That is, of course, if you don't want ANYTHING displayed before this point Example: 1 2 3 4 5 cfcontent reset=yes /6 Would result in the source of just... 6 ..:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: James Smith [mailto:[EMAIL PROTECTED] Sent: Monday, September 03, 2007 8:47 AM To: CF-Talk Subject: Application.cfc adding whitespace I have a cfm page which must at all costs return a simple pipe delimited list with no whitespace before or after it. Application.cfc is adding some and messing everything up. For now I have fixed the problem by moving the relevant cfm page into its own folder with its own [blank] application.cfc but the has got to be a better long term solution. Anyone any ideas? -- Jay No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.484 / Virus Database: 269.13.2/985 - Release Date: 02/09/2007 16:32 ~| Enterprise web applications, build robust, secure scalable apps today - Try it now ColdFusion Today ColdFusion 8 beta - Build next generation apps Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287657 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Application.cfc adding whitespace
Output=no doesn't quite work (almost but not quite) since setting it on the onRequest() function results in no output being sent to the browser at all! However, adding cfcontent reset=yes directly before cfinclude template=#Arguments.targetPage# in the onRequest() function seems to have solved that. Cheers all. -- Jay No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.484 / Virus Database: 269.13.2/985 - Release Date: 02/09/2007 16:32 ~| Get involved in the latest ColdFusion discussions, product development sharing, and articles on the Adobe Labs wiki. http://labs/adobe.com/wiki/index.php/ColdFusion_8 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287660 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Application.cfc adding whitespace
Is output set to false? You can also use cfcontent reset=yes / just before any output in the calling page to reset any white space. That is, of course, if you don't want ANYTHING displayed before this point I always like usin that one for the doctype in a header. :) me ~| ColdFusion is delivering applications solutions at at top companies around the world in government. Find out how and where now http://www.adobe.com/cfusion/showcase/index.cfm?event=finderproductID=1522loc=en_us Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287664 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Application.cfc adding whitespace
Yep ;-) ..:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Will Tomlinson [mailto:[EMAIL PROTECTED] Sent: Monday, September 03, 2007 3:58 PM To: CF-Talk Subject: Re: Application.cfc adding whitespace Is output set to false? You can also use cfcontent reset=yes / just before any output in the calling page to reset any white space. That is, of course, if you don't want ANYTHING displayed before this point I always like usin that one for the doctype in a header. :) me ~| ColdFusion 8 - Build next generation apps today, with easy PDF and Ajax features - download now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287667 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: application.cfc onError
I googled for 'cflocation application.cfc onerror' and this was the first result (the fix for it) http://www.coldfusionjedi.com/index.cfm/2005/9/28/Two-Nice-Fixes-in-Cold Fusion-701 You can either update to CF 7.01 (why are you not up to date??) or you can put this into your onError method: cfif arguments.exception.rootCause eq coldfusion.runtime.AbortException cfreturn/ /cfif Chris Peterson Gainey IT Adobe Certified Advanced Coldfusion Developer -Original Message- From: Chad Gray [mailto:[EMAIL PROTECTED] Sent: Monday, August 27, 2007 9:16 AM To: CF-Talk Subject: application.cfc onError I started using the onError function. I get the below error on one page. Any ideas? The code runs fine, I just get an email everytime the page is hit since I started using onError. It does not like my use of CFLocation, but it seems to work fine and I don't see any typos. TagContext array 1 struct COLUMN 0 ID CFLOCATION LINE 92 RAW_TRACE at cffinjobmaterial2ecfm161837558.runPage(D:\www\Employee\finjobmaterial.cf m:92) TEMPLATE D:\www\Employee\finjobmaterial.cfm TYPE CFML Type coldfusion.runtime.AbortException ~| Enterprise web applications, build robust, secure scalable apps today - Try it now ColdFusion Today ColdFusion 8 beta - Build next generation apps Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287175 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: application.cfc onError
Oh wow! this server is not up to date. No wonder I was getting strange results from staging to production. Thanks! -Original Message- From: Peterson, Chris [mailto:[EMAIL PROTECTED] Sent: Monday, August 27, 2007 9:23 AM To: CF-Talk Subject: RE: application.cfc onError I googled for 'cflocation application.cfc onerror' and this was the first result (the fix for it) http://www.coldfusionjedi.com/index.cfm/2005/9/28/Two-Nice-Fixes-in-Cold Fusion-701 You can either update to CF 7.01 (why are you not up to date??) or you can put this into your onError method: cfif arguments.exception.rootCause eq coldfusion.runtime.AbortException cfreturn/ /cfif Chris Peterson Gainey IT Adobe Certified Advanced Coldfusion Developer -Original Message- From: Chad Gray [mailto:[EMAIL PROTECTED] Sent: Monday, August 27, 2007 9:16 AM To: CF-Talk Subject: application.cfc onError I started using the onError function. I get the below error on one page. Any ideas? The code runs fine, I just get an email everytime the page is hit since I started using onError. It does not like my use of CFLocation, but it seems to work fine and I don't see any typos. TagContext array 1 struct COLUMN 0 ID CFLOCATION LINE 92 RAW_TRACE at cffinjobmaterial2ecfm161837558.runPage(D:\www\Employee\finjobmaterial.cf m:92) TEMPLATE D:\www\Employee\finjobmaterial.cfm TYPE CFML Type coldfusion.runtime.AbortException ~| Enterprise web applications, build robust, secure scalable apps today - Try it now ColdFusion Today ColdFusion 8 beta - Build next generation apps Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287176 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: application.cfc question
Plenty of ways to do this, but I'd probably create a utilities.cfc and then drop it into the application scope (in OnApplicationStart()). That way, anytime you want to use it on your site, you just call it that way. The added benefit is if you find you have more functions liek this that you may need, just drop them into utilities.cfc. On 8/27/07, Chad Gray [EMAIL PROTECTED] wrote: I am switching an application.cfm to application.cfc. Im my application.cfm I defined a function that I used through out the web site. cfscript function replaceQuotes(arg) { return Replace(arg, '', ##34;, ALL); } /cfscript Now in the application.cfc I cannot place the function in onRequestStart I get an error. So now, to have this function available to the web site, I can just make a new function in application.cfc like this: cffunction name=replaceQuotes cfargument name=arg required=true cfreturn #Replace(arguments.arg, '', '##34;', 'ALL')# / /cffunction Right??? I just want to make sure I am doing this right and im not going to kill application.cfc. ~| Check out the new features and enhancements in the latest product release - download the What's New PDF now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287207 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: application.cfc question
Plenty of ways to do this, but I'd probably create a utilities.cfc and then drop it into the application scope (in OnApplicationStart()). That way, anytime you want to use it on your site, you just call it that way. I concur with Crow - I was going to suggest exactly the same thing. You could add the function right in App.cfc, then use cfinvoke to call the method, but I feel for cleanliness App.cfc should just contain those native functions (onApplicationStart etc.). -- Josh ~| Create robust enterprise, web RIAs. Upgrade to ColdFusion 8 and integrate with Adobe Flex http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287212 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: application.cfc and var
Also, it always helps to remember that Application.cfc is in NO WAY special or different than any other CFC you will ever write. The only difference is that the CF application server instantiates it for each page request and looks for certain methods to call for certain events... But the CFC itself is not special. Thinking that way for me helped clear up a lot of the magic that I thought was going on. .. Ben Nadel Certified Advanced ColdFusion MX7 Developer www.bennadel.com Need ColdFusion Help? www.bennadel.com/ask-ben/ -Original Message- From: Raymond Camden [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 01, 2007 6:24 PM To: CF-Talk Subject: Re: application.cfc and var I assume you mean in methods. Yes. The var rule also applies to UDFs as well. Var now. Var tomorrow. Var always. :) On 8/1/07, Chad Gray [EMAIL PROTECTED] wrote: Ok now that I have learned about declaring variables in CFCs so you don't run into race conditions and problems. How about application.cfc? Do I need to use cfset var foo = in application.cfc? ~| ColdFusion 8 - Build next generation apps today, with easy PDF and Ajax features - download now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:285311 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: application.cfc and var
I assume you mean in methods. Yes. The var rule also applies to UDFs as well. Var now. Var tomorrow. Var always. :) On 8/1/07, Chad Gray [EMAIL PROTECTED] wrote: Ok now that I have learned about declaring variables in CFCs so you don't run into race conditions and problems. How about application.cfc? Do I need to use cfset var foo = in application.cfc? ~| ColdFusion 8 - Build next generation apps today, with easy PDF and Ajax features - download now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:285104 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Application.cfc and missing templates
Jones Eric R Ctr 8 AF Det 1/AFNOC wrote: Why doesn't the Application.cfc file run when a template isn't found? Because technically the constructor code of Application.cfc is included in the template and that is a bit hard when the template isn't present. Anyone know how to catch these WITHOUT using the missing template handler in CF Administrator??? The missing templates handler in your webserver. Jochem ~| Macromedia ColdFusion MX7 Upgrade to MX7 experience time-saving features, more productivity. http://www.adobe.com/products/coldfusion?sdid=RVJW Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:273171 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: application.cfc problems
I am new to application.cfc and I am running into problems trying to use the onError function. I think I have narrowed it down to a cfabort in my onRequestStart function. Read this: http://ray.camdenfamily.com/index.cfm?mode=entryentry=ED9D4058-E661-02E9-E70A41706CD89724 That might solve your problem. Will ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 MX7 integration create powerful cross-platform RIAs http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:267146 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: application.cfc onError
Anyone know what this java.lang.NullPointerException is? There is nothing in the CF logs to help me figure out what this error is. I have found that this error often pops up when you try to use a date function such as DateDiff or DateFormat, and the value you are passing to the function is empty string rather than a date. Just a guess though, it could easily be something else. -- Josh ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:266699 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: application.cfc onError
I have started using application.cfc and sending an email when an error occurs by placing a CFMail tag in the onError function. I have one user that when she is doing an insert on a table and is taken back to the display page I get this error emailed to me. I think this was a bug. I know it happened to me when I redirected a user after login. Here's some good info about it on ray's blog. http://ray.camdenfamily.com/index.cfm?mode=entryentry=ED9D4058-E661-02E9-E70A41706CD89724 Will ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:266704 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: application.cfc onError
One tip - maybe do a structkeyexists on your exception values like type and tagcontext within rootcause. I see you using it for rootcause itself, but not the others. (Although message should always exist afaik.) Worse comes to worse - just mail a dump of the exception object and see the keys there. :) On 1/16/07, Chad Gray [EMAIL PROTECTED] wrote: I have started using application.cfc and sending an email when an error occurs by placing a CFMail tag in the onError function. I have one user that when she is doing an insert on a table and is taken back to the display page I get this error emailed to me. Event Name: Error Info: Message: Detail: Root Cause: Type: java.lang.NullPointerException Template: /catalogs/index.cfm?action=displayElementsCatalogID=49 Tag Context: Here is the code that I have in the function (I think I borrowed it from one of Ray Camden's applications). cfmail to=#application.adminEmail# from=#application.adminEmail# subject=Error type=html br / Event Name: #arguments.eventname#br / br / Error Info:br / Message:#arguments.exception.message#br / Detail: #arguments.exception.detail#br / Root Cause: br / cfif structKeyExists(arguments.exception,rootcause)cfdump var=#arguments.exception.rootcause#/cfif Type: #arguments.exception.type#br / Template: #cgi.script_name#?#cgi.query_string#br / Tag Context:br / cfif structKeyExists(arguments.exception,rootcause)cfdump var=#arguments.exception.rootcause.tagcontext#/cfif /cfmail Anyone know what this java.lang.NullPointerException is? There is nothing in the CF logs to help me figure out what this error is. Chad ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:266705 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Application.cfc vs cfm
That file structure formatting got messed up in the transfer. Amended: /root - Application.cfc - Index.cfm /root/subdirectory o Application.cfm o index.cfm ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264433 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Application.cfc vs cfm
I'm pretty darn sure it runs the first one it finds. Since your immediate dir has .cfm, it will be loaded. On 12/19/06, Ray Champagne [EMAIL PROTECTED] wrote: That file structure formatting got messed up in the transfer. Amended: /root - Application.cfc - Index.cfm /root/subdirectory o Application.cfm o index.cfm ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264434 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Application.cfc vs cfm
In my experience, the application.cfm wins out. Terrence Ryan Senior Systems Programmer Wharton Computing and Information Technology E-mail: [EMAIL PROTECTED] -Original Message- From: Ray Champagne [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 19, 2006 9:58 AM To: CF-Talk Subject: RE: Application.cfc vs cfm That file structure formatting got messed up in the transfer. Amended: /root - Application.cfc - Index.cfm /root/subdirectory o Application.cfm o index.cfm ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264435 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Application.cfc vs cfm
Hi Ray, in Railo 1.1 you can configure this setting. In the Railo administrator you will be able to set the Application Listeners as follows: Type: none - No Application.cfm and Application.cfc will be included classic - First look for Application.cfm and after the request for OnRequestEnd.cfm (like CF7) modern - Look only for Application.cfc mixed - Looks for Application.cfc and if not existing for Application.cfm/OnRequestEnf.cfm (Like = CF7) Mode: Current: Look only in the current directory for one of the files above Root: Look only in the root directory for one of the files above Curr2Root: Like CF So you can configure Railo in the way you like... Greetings / Grüsse Gert Franz Customer Care Railo Technologies GmbH [EMAIL PROTECTED] www.railo.ch Join our Mailing List / Treten Sie unserer Mailingliste bei: deutsch: http://de.groups.yahoo.com/group/railo/ english: http://groups.yahoo.com/group/railo_talk/ Ray Champagne schrieb: Say I have the following directory/file structure: /root - Application.cfc - Index.cfm /subdirectory o Application.cfm o index.cfm My question is, since there is an Application.cfc in the parent directory, will the Application.cfm file be processed when calling /root/subdirectory/index.cfm, or will the Application.cfc be read? I know when a .cfm and a .cfc reside in the same directory, the .cfc is used, but I'm not sure about the above situation. Thanks, Ray ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264439 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Application.cfc vs cfm
I need to stop writing such terse responses. I was referring to his particular case. I've used application.cfm's for subfolders like CFC collections to block direct web access. It's often easier then writing a whole application cfc, just to redirect direct directory calls. Terrence Ryan Senior Systems Programmer Wharton Computing and Information Technology E-mail: [EMAIL PROTECTED] -Original Message- From: Raymond Camden [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 19, 2006 10:03 AM To: CF-Talk Subject: Re: Application.cfc vs cfm No - the .CFC wins. But in his case, the CFM was int he most immediate folder. On 12/19/06, Ryan, Terrence [EMAIL PROTECTED] wrote: In my experience, the application.cfm wins out. Terrence Ryan Senior Systems Programmer Wharton Computing and Information Technology E-mail: [EMAIL PROTECTED] -Original Message- From: Ray Champagne [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 19, 2006 9:58 AM To: CF-Talk Subject: RE: Application.cfc vs cfm That file structure formatting got messed up in the transfer. Amended: /root - Application.cfc - Index.cfm /root/subdirectory o Application.cfm o index.cfm ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264440 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Application.cfc vs cfm
FWIW --- The following text is quoted straight from the CFMX Development Guide that ships with CFMX7: !--- How ColdFusion MX finds and process application definition pages ColdFusion MX uses the following rules to locate and process the Application.cfc, Application.cfm, and OnRequestEnd.cfm pages that define application-specific elements. The way ColdFusion MX locates these files helps determine how you structure an application. Each time ColdFusion MX processes a page request it does the following: 1. When ColdFusion starts processing the request, it does the following: - It searches the page's directory for a file named Application.cfc. If one exists, it creates a new instance of the CFC, processes the initial events, and stops searching. (ColdFusion MX creates a new instance of the CFC and processes its initialization code for each request.) - If the requested page's directory does not have an Application.cfc file, it checks the directory for an Application.cfm file. If one exists, ColdFusion MX logically includes the Application.cfm page at the beginning of the requested page and stops searching further. - If the requested page's directory does not have an Application.cfc or Application.cfm file, ColdFusion MX searches up the directory tree and checks each directory first for an Application.cfc file and then, if one is not found, for an Application.cfm page, until it reaches the root directory (such as C:\). When it finds an Application.cfc or Application.cfm file, it processes the page and stops searching. 2. ColdFusion MX processes the requested page's contents. 3. When the request ends, ColdFusion MX does the following: - If you have an Application.cfc, ColdFusion MX processes the CFC's onRequestEnd method and releases the CFC instance. - If you do not have an Application.cfc, but do have an Application.cfm page, ColdFusion MX looks for an OnRequestEnd.cfm in the same directory as the Application.cfm page ColdFusion uses for the current page. ColdFusion does not search beyond that directory, so it does not run an OnRequestEnd.cfm page that resides in another directory. Also, the OnRequestEnd.cfm page does not run if there is an error or an exception on the application page, or if the application page executes the cfabort or cfexit tag. --- HTH... Robert Mansen Electronics Engineer WRALC/ITMS Bldg 301 West Room C09, Cube 20 Robins AFB, GA 31098 (478) 222-3156 -Original Message- From: Ray Champagne [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 19, 2006 9:53 AM To: CF-Talk Subject: Application.cfc vs cfm Say I have the following directory/file structure: /root - Application.cfc - Index.cfm /subdirectory o Application.cfm o index.cfm My question is, since there is an Application.cfc in the parent directory, will the Application.cfm file be processed when calling /root/subdirectory/index.cfm, or will the Application.cfc be read? I know when a .cfm and a .cfc reside in the same directory, the .cfc is used, but I'm not sure about the above situation. Thanks, Ray ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264441 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Application.cfc vs cfm
While on this subject. Considering CFC's are slower to instantiate compared to regular .cfm files, how does this affect application.cfm, has anyone tested? Is it slower than using application.cfm and onrequestend.cfm Russ -Original Message- From: Gert Franz [mailto:[EMAIL PROTECTED] Sent: 19 December 2006 15:11 To: CF-Talk Subject: Re: Application.cfc vs cfm Hi Ray, in Railo 1.1 you can configure this setting. In the Railo administrator you will be able to set the Application Listeners as follows: Type: none - No Application.cfm and Application.cfc will be included classic - First look for Application.cfm and after the request for OnRequestEnd.cfm (like CF7) modern - Look only for Application.cfc mixed - Looks for Application.cfc and if not existing for Application.cfm/OnRequestEnf.cfm (Like = CF7) Mode: Current: Look only in the current directory for one of the files above Root: Look only in the root directory for one of the files above Curr2Root: Like CF So you can configure Railo in the way you like... Greetings / Grüsse Gert Franz Customer Care Railo Technologies GmbH [EMAIL PROTECTED] www.railo.ch Join our Mailing List / Treten Sie unserer Mailingliste bei: deutsch: http://de.groups.yahoo.com/group/railo/ english: http://groups.yahoo.com/group/railo_talk/ Ray Champagne schrieb: Say I have the following directory/file structure: /root - Application.cfc - Index.cfm /subdirectory o Application.cfm o index.cfm My question is, since there is an Application.cfc in the parent directory, will the Application.cfm file be processed when calling /root/subdirectory/index.cfm, or will the Application.cfc be read? I know when a .cfm and a .cfc reside in the same directory, the .cfc is used, but I'm not sure about the above situation. Thanks, Ray ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:26 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Application.cfc vs cfm
Should read how does this affect application.cfc -Original Message- From: Snake [mailto:[EMAIL PROTECTED] Sent: 19 December 2006 15:48 To: CF-Talk Subject: RE: Application.cfc vs cfm While on this subject. Considering CFC's are slower to instantiate compared to regular .cfm files, how does this affect application.cfm, has anyone tested? Is it slower than using application.cfm and onrequestend.cfm Russ -Original Message- From: Gert Franz [mailto:[EMAIL PROTECTED] Sent: 19 December 2006 15:11 To: CF-Talk Subject: Re: Application.cfc vs cfm Hi Ray, in Railo 1.1 you can configure this setting. In the Railo administrator you will be able to set the Application Listeners as follows: Type: none - No Application.cfm and Application.cfc will be included classic - First look for Application.cfm and after the request for OnRequestEnd.cfm (like CF7) modern - Look only for Application.cfc mixed - Looks for Application.cfc and if not existing for Application.cfm/OnRequestEnf.cfm (Like = CF7) Mode: Current: Look only in the current directory for one of the files above Root: Look only in the root directory for one of the files above Curr2Root: Like CF So you can configure Railo in the way you like... Greetings / Grüsse Gert Franz Customer Care Railo Technologies GmbH [EMAIL PROTECTED] www.railo.ch Join our Mailing List / Treten Sie unserer Mailingliste bei: deutsch: http://de.groups.yahoo.com/group/railo/ english: http://groups.yahoo.com/group/railo_talk/ Ray Champagne schrieb: Say I have the following directory/file structure: /root - Application.cfc - Index.cfm /subdirectory o Application.cfm o index.cfm My question is, since there is an Application.cfc in the parent directory, will the Application.cfm file be processed when calling /root/subdirectory/index.cfm, or will the Application.cfc be read? I know when a .cfm and a .cfc reside in the same directory, the .cfc is used, but I'm not sure about the above situation. Thanks, Ray ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264446 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Application.cfc vs cfm
Sounds good, but isn't he using ColdFusion? This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant, Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business, Registered in England, Number 678540. It contains information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender or call our switchboard on +44 (0) 20 89107910. The opinions expressed within this communication are not necessarily those expressed by Reed Exhibitions. Visit our website at http://www.reedexpo.com -Original Message- From: Gert Franz To: CF-Talk Sent: Tue Dec 19 15:11:10 2006 Subject: Re: Application.cfc vs cfm Hi Ray, in Railo 1.1 you can configure this setting. In the Railo administrator you will be able to set the Application Listeners as follows: Type: none - No Application.cfm and Application.cfc will be included classic - First look for Application.cfm and after the request for OnRequestEnd.cfm (like CF7) modern - Look only for Application.cfc mixed - Looks for Application.cfc and if not existing for Application.cfm/OnRequestEnf.cfm (Like = CF7) Mode: Current: Look only in the current directory for one of the files above Root: Look only in the root directory for one of the files above Curr2Root: Like CF So you can configure Railo in the way you like... Greetings / Grüsse Gert Franz Customer Care Railo Technologies GmbH [EMAIL PROTECTED] www.railo.ch Join our Mailing List / Treten Sie unserer Mailingliste bei: deutsch: http://de.groups.yahoo.com/group/railo/ english: http://groups.yahoo.com/group/railo_talk/ Ray Champagne schrieb: Say I have the following directory/file structure: /root - Application.cfc - Index.cfm /subdirectory o Application.cfm o index.cfm My question is, since there is an Application.cfc in the parent directory, will the Application.cfm file be processed when calling /root/subdirectory/index.cfm, or will the Application.cfc be read? I know when a .cfm and a .cfc reside in the same directory, the .cfc is used, but I'm not sure about the above situation. Thanks, Ray ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264452 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Application.cfc vs cfm
While on this subject. Considering CFC's are slower to instantiate compared to regular .cfm files, how does this affect application.cfm, has anyone tested? Is it slower than using application.cfm and onrequestend.cfm I haven't bothered doing any testing. However, I haven't seen any evidence that CFCs are inherently slower than CFM files. I don't see any reason why they would be, either, once compiled. I can see why they might take longer to compile, since every method is compiled into a separate class, but this shouldn't be an issue in a busy production environment. It is slower to invoke a CFC from within a CFM file than not to. It appears, in my limited testing, to be slower to use any formal code reuse mechanism (CFC invocation, CFML custom tags) than to run code inline or to use a CFINCLUDE. Finally, even if there were a cost to doing this, you should only have to pay it once, when Application.cfc is compiled. So, in summary, I wouldn't avoid Application.cfc because of performance concerns. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264457 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Application.cfc vs cfm
The only problem with using Railo is it doesn't amount to any savings for those of us who host multiple websites on our own server. The price is practically the same as Adobe's CF server. If the price were significantly less, then it would be more attractive and worth the effort to do the work necessary to implement a 3rd party CF server. Rick -Original Message- From: Gert Franz [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 19, 2006 10:11 AM To: CF-Talk Subject: Re: Application.cfc vs cfm Hi Ray, in Railo 1.1 you can configure this setting. In the Railo administrator you will be able to set the Application Listeners as follows: Type: none - No Application.cfm and Application.cfc will be included classic - First look for Application.cfm and after the request for OnRequestEnd.cfm (like CF7) modern - Look only for Application.cfc mixed - Looks for Application.cfc and if not existing for Application.cfm/OnRequestEnf.cfm (Like = CF7) Mode: Current: Look only in the current directory for one of the files above Root: Look only in the root directory for one of the files above Curr2Root: Like CF So you can configure Railo in the way you like... Greetings / Grüsse Gert Franz Customer Care Railo Technologies GmbH [EMAIL PROTECTED] www.railo.ch ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264462 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Application.cfc vs cfm
Well I have noticed that the time to instantiate a CFC, using cfinvoke or createobject is slower than using a customtag, a clinclude or a UDF. And the only way to avoid this is to cache the cfc in a persistent scope, such as application. When I first tried out the Model-Glue framework I found the speed to be dire, the pages took seconds to load, compared to milliseconds for the same site not done using CFC's Russ -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: 19 December 2006 17:09 To: CF-Talk Subject: RE: Application.cfc vs cfm While on this subject. Considering CFC's are slower to instantiate compared to regular .cfm files, how does this affect application.cfm, has anyone tested? Is it slower than using application.cfm and onrequestend.cfm I haven't bothered doing any testing. However, I haven't seen any evidence that CFCs are inherently slower than CFM files. I don't see any reason why they would be, either, once compiled. I can see why they might take longer to compile, since every method is compiled into a separate class, but this shouldn't be an issue in a busy production environment. It is slower to invoke a CFC from within a CFM file than not to. It appears, in my limited testing, to be slower to use any formal code reuse mechanism (CFC invocation, CFML custom tags) than to run code inline or to use a CFINCLUDE. Finally, even if there were a cost to doing this, you should only have to pay it once, when Application.cfc is compiled. So, in summary, I wouldn't avoid Application.cfc because of performance concerns. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264482 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Application.cfc vs cfm
Well it depends... If you only see the the price then yes, Railo is as cheap or as expensive as CFMX. But, you can use the professional version with unlimited webs wich costs 900¤ and is therefore cheaper than CFMX. AND the enterprise version of Railo is at the price of one fourth of the price of CFMX enterprise. And if you compare the features, then Railo does much more than CFMX. Webs are logically separated, and you have a web administrator for each web and a server administrator for the administering of the security settings and of the global settings. You additionally have - Railo archives - Railo resources - Performance improvements etc... Greetings / Grüsse Gert Franz Customer Care Railo Technologies GmbH [EMAIL PROTECTED] www.railo.ch Join our Mailing List / Treten Sie unserer Mailingliste bei: deutsch: http://de.groups.yahoo.com/group/railo/ english: http://groups.yahoo.com/group/railo_talk/ Rick Faircloth schrieb: The only problem with using Railo is it doesn't amount to any savings for those of us who host multiple websites on our own server. The price is practically the same as Adobe's CF server. If the price were significantly less, then it would be more attractive and worth the effort to do the work necessary to implement a 3rd party CF server. Rick -Original Message- From: Gert Franz [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 19, 2006 10:11 AM To: CF-Talk Subject: Re: Application.cfc vs cfm Hi Ray, in Railo 1.1 you can configure this setting. In the Railo administrator you will be able to set the Application Listeners as follows: Type: none - No Application.cfm and Application.cfc will be included classic - First look for Application.cfm and after the request for OnRequestEnd.cfm (like CF7) modern - Look only for Application.cfc mixed - Looks for Application.cfc and if not existing for Application.cfm/OnRequestEnf.cfm (Like = CF7) Mode: Current: Look only in the current directory for one of the files above Root: Look only in the root directory for one of the files above Curr2Root: Like CF So you can configure Railo in the way you like... Greetings / Grüsse Gert Franz Customer Care Railo Technologies GmbH [EMAIL PROTECTED] www.railo.ch ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264499 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: application.cfc
You could just use jsstringformat() to escape strings in javascript ..:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Chad Gray [mailto:[EMAIL PROTECTED] Sent: Thursday, December 14, 2006 11:43 AM To: CF-Talk Subject: application.cfc I am starting to use application.cfc and when I placed this function that I use to escape quotes I get an error. I have it in the onRequestStart function. Should I have it elsewhere? !--- escape quotes for javacript messages --- cfscript function escapeQuotes(str) { return replace(str, ', \', ALL); } /cfscript Unable to complete CFML to Java translation. Error information unsupported statement: class coldfusion.compiler.ASTfunctionDefinition ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264052 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4