application.cfc

Global Variables in ColdFusion

烈酒焚心 提交于 2019-12-12 19:23:13
问题 2 Questions - In CF8 in the application.cfm I cold set a global variable like so <cfset DSN = "dej6_42"> I am now trying to adjust to the Application.cfc in CF10/Lucee and can not figure out how to set this same variable. Here is my current Application.cfc <cfcomponent output="false"> <cfset This.name = "My Application"> <cfset This.clientmanagement="True"> <cfset This.loginstorage="Session"> <cfset This.sessionmanagement="True"> <cfset This.sessiontimeout="#createtimespan(0,0,10,0)#"> <cfset

Why don't I get a recursive infinite loop when throwing an error in the onError function?

无人久伴 提交于 2019-12-11 14:26:50
问题 In my coldfusion Application.cfc file, I define an onError function. In certain situations, I explicitly throw an exception using a cfthrow tag - e.g. <cfthrow object="#myException#"> . My question is, why doesn't this create an infinite loop? Or at least cause another call to the onError function? (Instead, it just dumps the error to the screen. Which is the functionality I want, actually :) - but I'm still confused about why this happens.) 回答1: This is expected and documented behavior: If

refactor cferror tag to application.cfc's onError()

﹥>﹥吖頭↗ 提交于 2019-12-11 11:44:21
问题 How to translate <cferror type="EXCEPTION" template="ErrorTemplate.cfm"> to an onError() function for Application.cfc? Notice that cferror create a var error struct for the template. Is there a quick and easy way to create the same error struct? How to pass that into ErrorTemplate.cfm using <cfinclude> ? I know onRequest() shares the variable scope with the target page, but does onError share variables scope too? If not, what shall I do? Stick it to the Form scope? Thank you 回答1: According to

Setting up Session variable in Application.cfc

故事扮演 提交于 2019-12-11 03:02:52
问题 Hi I'm very new with ColdFusion 10 especially with Application.cfc. It is very confusing. I created Application.cfc and inside this cfc I created the following: My questions are: 1. Why do I get session error? (see my codes below) 2. What should I put in sessionEnd function? <!--- Application.cfc ---> <CFCOMPONENT displayname="Application" output="true"> <cfset THIS.Name = "MyTestApp" /> <cfset THIS.ApplicationTimeout = CreateTimeSpan(0,0,60,0) /> <cfset THIS.SessionManagement = true />

In ColdFusion, how do you explicitly reference the “THIS” scope defined in Application.cfc?

与世无争的帅哥 提交于 2019-12-11 01:58:41
问题 Is there a way to explicitly reference the THIS scope defined in Application.cfc? Say I have an Application.cfc like this: component { this.name="MyApplication" .. I know that from any page in the site, you can access this.name this way... <cfoutput>#this.name#</cfoutput> ...but if you are in another component, how would you reach the Application.cfc's "this" scope? Is it possible without handing the var off? Adobe documentation says that you can reference the "THIS" scope by using the

ColdFusion: Are there any use cases where an Application.cfm is preferable to an Application.cfc

谁说胖子不能爱 提交于 2019-12-08 20:35:23
问题 I'm in the process of upgrading a large legacy ColdFusion application that heavily utilizes Application.cfm template files instead of the newer Application.cfc files. It seems that Application.cfc offer a cleaner more efficient solution to everything that a Application.cfm file can do. An Application.cfm runs every line sequentially for every request, so it would recreate application variables on every subsequent new page query. (Can cause performance hit if many application variables loaded)

How do I create Search Engine Safe URLs in Fusebox 5.1 noxml?

假如想象 提交于 2019-12-08 07:33:08
问题 How do I create Search Engine Safe URLs in Fusebox 5.1 noxml? For instance, I want this: http://www.site.com/index.cfm/app.welcome/ Instead of this: http://www.site.com/index.cfm?fuseaction=app.welcome Fusebox 5.1 is suppose to be able to do this. I've read this article, but it only applies to the xml version. I know so little, I am not sure where to start. How do I do it with the noxml version of fusebox? Update : It looks like I need to add this to my Application.cfc file. Still not working

How can I include mappings into Application.cfc from external property file?

纵然是瞬间 提交于 2019-12-06 03:17:35
问题 I have trouble with setting mappings in Application.cfc We have diverent Server (dev,QS,prod) Each with a little different Pathes. I want to set serverspecific pathes and variables via configuration file. On ApplicationStart you read the ini file and setup your system. http://www.raymondcamden.com/index.cfm/2005/8/26/ColdFusion-101-Config-Files-AGoGo This works fine. Normaly you set mappings in Applcation.cfc like this: <!--- in Application.cfc ---> <cfset this.mappings['/components'] = "D:

How do I reset application.cfc without resetting the server instance? [duplicate]

我的梦境 提交于 2019-12-05 10:48:59
This question already has answers here : Closed 7 years ago . Possible Duplicate: restart application without restarting server? How do I reset a Coldfusion Application / application.cfc without resetting the Coldfusion Server instance? If I remember right, there are a few tricks out there such as creating a reinit function within application.cfc or renaming the file. A couple of steps: First, make sure all your application initialization logic is contained inside the OnApplicationStart method of your CFC. If it has nested calls, that is fine - just so long as you can re-initialize your

How can I include mappings into Application.cfc from external property file?

Deadly 提交于 2019-12-04 07:33:25
I have trouble with setting mappings in Application.cfc We have diverent Server (dev,QS,prod) Each with a little different Pathes. I want to set serverspecific pathes and variables via configuration file. On ApplicationStart you read the ini file and setup your system. http://www.raymondcamden.com/index.cfm/2005/8/26/ColdFusion-101-Config-Files-AGoGo This works fine. Normaly you set mappings in Applcation.cfc like this: <!--- in Application.cfc ---> <cfset this.mappings['/components'] = "D:\Inetpub\wwwroot\myApp\components"> Somewhere in a normal cfm File I instatiate a cfc named test via: