coldfusion-9

How to dynamically call a method from a different component by using cfscript?

心已入冬 提交于 2019-12-22 04:38:24
问题 I'm looking for the best way to dynamically call a method from a different component in cfscript. Notice that it's concerning a method in a different component. So far I've tried 3 different methods, but none of them seem be exactly what I'm looking for: All cases are written in cfscript inside a component method. Let's say I'm trying to dynamically call the setName(required string name) method in the MyComponent component. All cases have following variables defined: var myComp = new

Coldfusion Local scope outside of a function?

霸气de小男生 提交于 2019-12-21 20:44:25
问题 What exactly is the local scope defined outside of a function? Consider the following code: <cfscript> local.madVar2 = "Local scope variable"; function madness() { var madVar = "madness variable"; madVar2 = "madness two variable"; writeOutput("local: <BR>"); writeDump(local); writeOutput("========================================= <BR>"); writeOutput("local.madVar2: <BR>"); writeDump(local.madVar2); writeOutput("<BR>========================================= <BR>"); writeOutput("madVar2: <BR>")

Coldfusion mapping error

自作多情 提交于 2019-12-20 07:16:53
问题 Note: If you wish to use an absolute template path (for example, template="/mypath/index.cfm") with CFINCLUDE, you must create a mapping for the path using the ColdFusion Administrator. I went to the administration page but not sure what to put in here. I'm pretty new to coldfusion. anyone got any ideas why this would be happening. 回答1: CFINCLUDE uses relative paths in relation to the file where the cfinclude is, so if want to include a file in another directory, 1. it has to be inside your

What are current CF9.02 Session Cookie Management Best Practices?

对着背影说爱祢 提交于 2019-12-19 19:49:06
问题 Common "best practice" for ColdFusion cookie session cookie management has been to implement something like this: <cfset this.setClientCookies = false /> <cfif NOT IsDefined( "cookie.cfid" ) OR NOT IsDefined( "cookie.cftoken" )> <cfcookie name="cfid" value="#session.cfid#" domain=".#cgi.HTTP_HOST#" path="/test/sessiontest"> <cfcookie name="cftoken" value="#session.cftoken#" domain=".#cgi.HTTP_HOST#" path="/test/sessiontest"> </cfif> OR <cfif IsDefined("Cookie.CFID") AND IsDefined("Cookie

Scoping: Local vs Var

烂漫一生 提交于 2019-12-19 07:23:06
问题 I'm new to CF so this may be a basic question. But I've heard I should use local for objects inside functions due to how scoping works in CF. But what about 'var'? Is var the same as using local? e.g. function MyFunction() { local.obj = {}; } Is this the same as: function MyFunction() { var obj = {}; } If they aren't the same, what is the difference between them? And when should I be using either of them? 回答1: They are very similar, but not exactly the same. Both only exist inside of a

how to loop through Query Columns in ColdFusion

被刻印的时光 ゝ 提交于 2019-12-18 19:41:12
问题 I have a query in a my CFC. The function contains a simple query as such. <cfquery name="qrySE" datasource=#mydatasource#> SELECT NAMES,SALARY FROM tblTest </cfquery> I want to display my resultset as such (horizontally): NAME1 NAME2 NAME3 NAME4 10 20 45 62 Is there a way to loop through the columns of my query and create a virtual query for this purpose? If anyone has done this, please let me know. 回答1: Just wanted to add Al Everett's solution returns the columns back in alphabetical order.

Getting ColdFusion-Called Web Service to Work with JavaLoader-Loaded Objects

孤人 提交于 2019-12-17 17:05:29
问题 Is it possible to use JavaLoader to get objects returned by CF-called web services, and JavaLoader-loaded objects to be the same classpath context? I mean, without a lot of difficulty? // get a web service ws = createObject("webservice", local.lms.wsurl); // user created by coldfusion user = ws.GenerateUserObject(); /* user status created by java loader. ** this api provider requires that you move the stubs ** (generated when hitting the wsdl from CF for the first time) ** to the classpath. *

ColdFusion & Ajax: Error Invoking CFC

不问归期 提交于 2019-12-13 19:24:15
问题 I have tried multiple tutorials on this topic from Forta.com and yet run into the same error: "Error invoking CFC/....(file path)../wgn.cfc: Internal Server Error [Enable debugging by adding 'cfdebug to your URL parameters to see more info]" I am working on my local machine and testing as localhost. Running WinXP Pro with sp3. Using Coldfusion's web server. Both my .cfm and .cfc are in the same folder under the the webroot. In my case: c:\ColdFusion9\wwwroot\bridges(.cfm and .cfc here) So,

ColdFusion mail sending capacity

北城余情 提交于 2019-12-13 18:01:51
问题 I am currently working on a newsletter application which needs to sent around 20K mails in a single shot. I feel, ColdFusion mail sending capacity will not be suitable for this. I don’t have any metrics with me to prove this. I searched around in web about this, I found there are lot of complains about this kind of bulk mail sending process using built in CFMAIL. Few of them are, Java heap size error IOException while sending message Mail Spool Lock Mail Spool Timeout We are using Adobe

Why would regex to separate filename from extension not work in ColdFusion?

若如初见. 提交于 2019-12-13 16:14:19
问题 I'm trying to retrieve a filename without the extension in ColdFusion. I am using the following function: REMatchNoCase( "(.+?)(\.[^.]*$|$)" , "Doe, John 8.15.2012.docx" ); I would like this to return an array like: ["Doe, John 8.15.2012","docx"] but instead I always get an array with one element - the entire filename: ["Doe, John 8.15.2012.docx"] I tried the regex string above on rexv.org and it works as expected, but not on ColdFusion. I got the string from this SO question: Regex: Get