Questions tagged [cfc]

ColdFusion Components (CFCs) are objects in the ColdFusion environment. They are a collection of functions and properties.

ColdFusion Components (CFCs) are objects in the environment.

A component method is invoked in the following ways:

  • In the <cfinvoke> tag (Transient objects)

  • In the <cfobject> tag

  • In a URL that calls a CFC file and passes a method name as a URL parameter

  • By using createobject() in <cfscript> or in <cfset>

  • via web services

  • From code

Unlike normal ColdFusion files, CFCs have a .cfc extension.

458 questions
26
votes
4 answers

Are ColdFusion objects passed by reference or by value?

Are ColdFusion objects (i.e. CFCs invoked via cfobject) normally passed by reference or by value (copied in memory)? And is it possible to force ColdFusion to pass an object in either manner?
Soldarnal
  • 6,948
  • 9
  • 44
  • 65
17
votes
6 answers

In Coldfusion, how do I init a component that is located above the current path folder?

If I have a folder structure that looks like this: / /bin/myComponent.cfc /reports/index.cfm How do I initiate myComponent.cfc from index.cfm? myService = createObject("component", "bin.myComponent"); Using the dot syntax, I know how to go to…
Dan Sorensen
  • 10,465
  • 18
  • 65
  • 98
13
votes
4 answers

Can a ColdFusion cfc method determine its own name?

I am creating an API, and within each method I make a call to a logging method for auditing and troubleshooting. Something like:
Ryan Stille
  • 1,314
  • 1
  • 13
  • 18
13
votes
4 answers

Extending application.cfc in a subdirectory

I have the following two files and would like the second to extend the first: wwwroot\site\application.cfc wwwroot\site\dir\application.cfc However, when I go to declare the component for the second file, I'm not sure what to put in the extends…
Soldarnal
  • 6,948
  • 9
  • 44
  • 65
12
votes
4 answers

Mapping to a CFC in ColdFusion

In my application I have all my CFC's in a cfc folder. From the site root I can access them without any trouble by simply referring to them in my tag as component=cfc.mycomponent method=mymethod The trouble is, when I want to access the…
Ofeargall
  • 4,400
  • 5
  • 25
  • 32
12
votes
8 answers

ColdFusion Server CFC Caching Issue

I develop coldFusion applications on my laptop with it's own ColdFusion 8 server with IIS which run on Windows Vista. I am having a rather annoying problem. The problem is whenever I make any changes to my CFC's, it appears that unless I restart my…
GavinWoods
  • 803
  • 2
  • 13
  • 28
11
votes
3 answers

How do I determine the context in which a ColdFusion object resides?

So, given that I have an instance of this component: foo.cfc And, this other component, fooParent.cfc:
Jake Feasel
  • 15,917
  • 5
  • 48
  • 64
11
votes
1 answer

coldfusion - receiving posted JSON data and parsing it

This is the first time I'm writing a cfc that will catch JSON data from an external web server that would be posting information. I'm working with a new service that can be set to send us, via HTTP POST to a URL I specify, a JSON packet of…
Steve
  • 2,052
  • 2
  • 19
  • 37
11
votes
4 answers

Find who's calling the method

I'd like to somehow find out which CFC is calling my method. I have a logging CFC which is called by many different CFC's. On this logging CFC there's a need to store which CFC called for the log. Whilst I could simply pass the CFC name as an…
Marcos Placona
  • 20,531
  • 11
  • 62
  • 92
11
votes
1 answer

Extending ColdFusion with application wide UDFs

I've been exploring different methods of structuring my ColdFusion applications and I'm looking for some opinions on the best way to provide application wide UDFs. For each of my apps, I generally use a bunch of extra functions that don't really…
Gary Stanton
  • 1,414
  • 12
  • 27
11
votes
1 answer

How do you call a cffunction in a cfc from another cfm page using cfscript?

I have a test.cfm page and would like to call a cfc with a named errorEmail using from that page (test.cfm) instead of
isurfbecause
  • 959
  • 2
  • 15
  • 30
10
votes
4 answers

Extend a CFC using a relative path

I want to extend a CFC in a different directory and I have a couple of options, but can't figure out how to do this: A) Use a dynamic mapping (this will have to be dynamic based on the site, e.g. for the live site it would be cfc.myPackage.MyCFC but…
DEfusion
  • 5,463
  • 5
  • 42
  • 59
10
votes
2 answers

What's the correct way to allow different ColdFusion CFC's to instance each other?

I have a “best-practices” question in regards to the correct way to instance CFCs that all need to talk to each other in a given project. Let’s say for example you have a web application that has a bunch of different modules in it: Online…
Dave L
  • 2,465
  • 1
  • 14
  • 20
9
votes
4 answers

Collection of ColdFusion CFC Best/Recommended Practices?

I have been building a list of CFC best practices to share. There are a numerous of articles out there but I thought it might be neat to get any tricks and tips together here in one place that have been learnt through experience. I'll add a few…
Jas Panesar
  • 6,599
  • 3
  • 34
  • 45
9
votes
6 answers

How can I run a ColdFusion scheduled task at an interval <60 seconds?

I have a CFC method that I would like to run at an interval of 30 seconds. However, the problem is ColdFusion won't let me schedule a task that runs at an interval of 60 seconds or lower. Does anyone have a suggestion about how I can (and should)…
Joe D
  • 3,328
  • 2
  • 16
  • 14
1
2 3
30 31