| Contents > CFML Reference > ColdFusion Java CFX Reference > Response interface > setVariable |
|
|
|
|
||
Sets a variable in the calling template. If the variable name specified exists in the template, its value is replaced. If it does not exist, a new variable is created.
public void setVariable(Stringname, Stringvalue)
IllegalArgumentException If the name parameter is not a valid CFML variable name.
Parameter |
Description |
|---|---|
name |
The name of the variable to set |
value |
The value to set the variable to |
For example, this code sets the value of a variable named MessageSent based on the success of an operation performed by the custom tag:
boolean bMessageSent ;
...attempt to send the message...
if ( bMessageSent == true )
{
response.setVariable( "MessageSent", "Yes" ) ;
}
else
{
response.setVariable( "MessageSent", "No" ) ;
}
|
|
||
| Contents > CFML Reference > ColdFusion Java CFX Reference > Response interface > setVariable |
|
|
ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting
Version 6.1
Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.