Name

CFSERVLETPARAM — New as of ColdFusion 4.5

Synopsis

<CFSERVLET> 
  [<CFSERVLETPARAM>]
  ... 
</CFSERVLET>

Used as a child tag of the CFSERVLET tag to pass parameters and attributes to a Java servlet. Multiple CFSERVLETPARAM tags may pass multiple parameters/attributes. Both simple and complex datatypes such as arrays, queries, and structures can be passed to servlets via CFSERVLETPARAM tags.

Data can be passed to a servlet in two ways: by value and by reference. To pass data by value (as a parameter), use the NAME and VALUE attributes. Data passed by value is modified only within the servlet. To pass data by reference (as an attribute), use the NAME, VARIABLE, and optionally the TYPE attribute. If the servlet modifies data passed by reference, the data in the corresponding ColdFusion variable is also changed.

Attributes

NAME=" parameter_name "

The name of the parameter to pass to the CFSERVLET tag when VALUE is also specified. If VARIABLE is used in lieu of VALUE, specifies the name of the Java attribute to associate with the ColdFusion variable specified in VARIABLE. Required.

TYPE="Bool|Date|Int|Real|String"

The datatype of the ColdFusion variable being passed to the servlet.Options are Bool, Date, Int, Real, and String. Optional. The default is String. To see how various ColdFusion datatypes map to Java equivalents, see Table A-1.

Table A-1. ColdFusion Datatypes and Java Equivalents

ColdFusion Datatype

TYPE Attribute

Java Equivalent

Boolean
Bool

java.lang.Bool

Date

Get Programming ColdFusion now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.