Adobe COLDFUSION 9 Manual page 201

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Building Blocks of ColdFusion Applications
Specifying the CFC location
When you instantiate or invoke a component, you can specify the component name only, or you can specify a qualified
path. To specify a qualified path, separate the directory names with periods, not backslashes. For example,
myApp.cfcs.myComponent specifies the component defined in myApp\cfcs\myComponent.cfc. For additional
information, see
"Saving and naming ColdFusion
ColdFusion uses the following rules to find the specified CFC:
• If you use a
or cfobject tag, or the CreateObject function, to access the CFC from a CFML page,
cfinvoke
ColdFusion searches directories in the following order:
Local directory of the calling CFML page
1
Web root
2
3
Directories specified on the Custom Tag Paths page of ColdFusion Administrator
• If you specify only a component name, ColdFusion searches each of these directories, in turn, for the component.
• If you specify a qualified path, such as myApp.cfcs.myComponent, ColdFusion looks for a directory matching the
first element of the path in each of these directories (in this example, myApp). If ColdFusion finds a matching
directory, it looks for a file in the specified path beneath that directory, such as myApp\cfcs\myComponent.cfc,
relative to each of these directories.
Note: If ColdFusion finds a directory that matches the first path element, but does not find a CFC under that directory,
ColdFusion returns a not found error and does not search for another directory.
• If you invoke a CFC method remotely, using a specific URL, a form field, Flash Remoting, or a web service
invocation, ColdFusion looks in the specified path relative to the web root. For form fields and URLs that are
specified directly on local web pages, ColdFusion also searches relative to the page directory.
Note: On UNIX and Linux systems, ColdFusion attempts to match a CFC name or custom tag name with a filename,
as follows: First, it attempts to find a file with the name that is all lowercase. If it fails, it tries to find a file whose case
matches the CFML case. For example, if you specify
ColdFusion first looks for mycomponent.cfc and, if it doesn't find it, ColdFusion looks for myComponent.cfc.
Passing parameters to methods
You pass parameters to a method in a CFC by using the cfinvoke tag, direct method invocations, or by passing
parameters in a URL.
Passing parameters to methods by using the cfinvoke tag
When you use the
cfinvoke
• As
tag attributes, in
cfinvoke
• In the
tag
cfinvoke
argumentcollection
• In the
tag body, using the cfinvokeargument tag
cfinvoke
You can use any combination of these methods in a single invocation. If you use the same name in two or three of these
methods, ColdFusion uses the value based on the following order of precedence:
tags
1
cfinvokeargument
2
attribute name-value pairs
cfinvoke
arguments
3
argumentcollection
components" on page 189.
<cfobject name="myObject" Component="myComponent">
tag, ColdFusion provides several methods for passing parameters to CFC methods:
format
name="value"
attribute
Last updated 8/5/2010
196
,

Advertisement

Table of Contents
loading

Table of Contents