Adobe COLDFUSION 9 Manual page 63

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
The CFML Programming Language
Scope
Description
thread local
Variables that are available only within a ColdFusion thread. For more information, see
Threads" on page 328.
URL
Contains parameters passed to the current page in the URL that is used to call it. The parameters are appended to
the URL in the format ?variablename = value[&variablename=value...]; for example
www.MyCompany.com/inputpage.cfm?productCode=A12CD1510&quantity=3.
If a URL includes multiple parameters with the same name, the resulting variable in the ColdFusion URL scope
consists of all parameter values separated by commas. For example, a URL of the form
http://localhost/urlparamtest.cfm? param=1&param=2&param=3 results in a URL.param variable value of 1,2,3
on the ColdFusion page.
Variables
The default scope for variables of any type that are created with the
variable is available only on the page on which it is created and any included pages (see also the Caller scope).
Variables scope variables created in a CFC are available only to the component and its functions, and not to the
page that instantiates the component or calls its functions.
Important: To prevent data corruption, you lock code that uses Session, Application, or Server scope variables. For more
information, see
"Using Persistent Data and
Creating and using variables in scopes
The following table shows how you create and reference variables in different scopes in your code. For more
information on the mechanisms for creating variables in most scopes, see
Scope prefix
Prefix required to
reference
(type)
Application
Yes
Arguments
No
Attributes
Yes
Caller
On the custom tag
page, Yes.
On the calling page,
No (Variables prefix
is optional).
Cffile
Yes
CGI
No
Client
No
Cookie
No
Locking" on page 301.
Where available
For multiple clients in one application over
multiple browser sessions. Surround code that
uses application variables in
cflock
Within the body of a user-defined function or
ColdFusion component method.
On a custom tag page, or inside a thread
On the custom tag page, by using the Caller
scope prefix.
On the page that calls the custom tag, as local
variables (Variables scope).
Following an invocation of
cffile
On any page. Values are specific to the latest
browser request.
For one client in one application, over multiple
browser sessions.
For one client in one or more applications and
pages, over multiple browser sessions.
Last updated 8/5/2010
and
cfset
cfparam
"Creating
variables" on page 39.
Created by
Specifying the prefix Application when you
create the variable.
blocks.
The calling page passing an argument in the
function call.
For custom tags, the calling page passing the
values to a custom tag page in the custom tag's
attributes.
For threads, the
cfthread
attribute values.
On the custom tag page, by specifying the prefix
Caller when you create the variable.
On the calling page, by specifying the prefix
Variables, or using no prefix, when you create
the variable.
.
A cffile tag.
The web server. Contains the server
environment variables that result from the
browser request.
Specifying the prefix Client when you create the
variable.
A cfcookie tag. You can also set memory-only
cookies by specifying the prefix Cookie when
you create the variable.
58
"Using ColdFusion
tags. A Variables scope
tag specifying

Advertisement

Table of Contents
loading

Table of Contents