Chapter 1: ColdFusion Tags
The first passes name-value pairs by value. This method uses the attributes NAME and
VALUE to pass a simple name-value string pair to the servlet. The NAME attribute
represents the name of the servlet parameter from which the string specified in the
VALUE attribute can be retrieved. Although the servlet can use these parameters as
input, it cannot change their values in the ColdFusion template.
The second passes a ColdFusion variable to the servlet by reference. This method uses
the attribute VARIABLE to pass the specified ColdFusion variable by reference to the
servlet. Within the servlet, the variable data is made available as servlet attributes in
the form of Java objects. On the Java side, the data can be manipulated, even changed,
and those changes will, in turn, change the value of the associated ColdFusion
variable.
When used in this mode, the NAME attribute represents the name of the servlet
attribute that will be created to hold the value of the ColdFusion variable. The
VARIABLE attribute represents the name, not the #value#, of a ColdFusion variable.
This ability to directly share ColdFusion variables with a servlet is a powerful extension
to the servlet API because it allows even complex ColdFusion objects such as
structures and result sets to be directly accessed from Java. The following table shows
the mapping between ColdFusion data types (specified with the TYPE attribute) and
the corresponding Java objects.
Data Types: CF versus Java
Type
INT
DOUBLE
BOOL
DATE
STRING
Array
Structure
CF query
result set
Note
http://www.allaire.com/products/Jrun/
In addition, in order to return a modified attribute to ColdFusion, thereby changing
the value of the ColdFusion variable, you need to call the servlet API setAttribute
method from the servlet to reset the value of the attribute.
in Java
java.lang.Integer
java.lang.Double
java.lang.Bool
java.util.Date
java.lang.String
java.util.Vector
java.util.Hashtable
com.allaire.util.RecordSet
(a WDDX-supplied utility class.)
You need to have JRun 3.0 in order for the Name/Variable functionality to
work. You can download the latest version of JRun at the following URL:
.
195
Need help?
Do you have a question about the COLDFUSION 4.5-CFML LANGUAGE and is the answer not in the manual?
Questions and answers