Configuring the Flash Remoting Gateway

The following parameters in the ColdFusion web.xml file point the Flash Remoting gateway to the gateway-config.xml file.

<init-param> 
    <param-name>gateway.configuration.file</param-name> 
    <param-value>/WEB-INF/gateway-config.xml</param-value> 
        </init-param> 
<init-param> 
    <param-name>whitelist.configuration.file</param-name> 
    <param-value>/WEB-INF/gateway-config.xml</param-value> 
</init-param> 
<init-param> 
    <param-name>whitelist.parent.node</param-name> 
    <param-value>gateway-config</param-value> 
</init-param>

Both the web.xml file and the gateway-config.xml file are located in the WEB-INF directory of your ColdFusion server. As a general rule, you do not have to change these web.xml settings.

ColdFusion MX 7 and later versions of ColdFusion configure Flash gateways differently from previous ColdFusion releases. Parameters that worked before this release are no longer supported, and you specify all configuration parameters in the gateway-config.xml file. Also, the Flash gateway now supports a whitelist, which specifies which remote sources can be accessed through the gateway. The two web.xml entries that identify the whitelist must specify your gateway-config.xml file and gateway-config as the parent node.

You can modify the gateway-config.xml file to configure service adapters, add service names to the whitelist, change the logging level, and specify how the gateway handles case sensitivity.

You can configure gateway features in the gateway-config.xml file as follows:

Feature

Description

service adapters

By default, the PageableResultSetAdapter, the ColdFusionAdapter, the CFCAdapter (for ColdFusion components), and the CFSSASAdapter (for server-side ActionScript) adapters are enabled in ColdFusion.

You can also enable the JavaBeanAdapter, JavaAdapter, EJBAdapter, ServletAdapter, and CFWSAdapter (for web services) by removing their enclosing comment symbols (<!-- and -->). The following service adapter tags are defined as the default tag values:

<service-adapters> 
  <adapter>flashgateway.adapter.resultset.PageableResultSetAdapter</adapter> 
  <adapter>coldfusion.flash.adapter.ColdFusionAdapter</adapter> 
  <adapter>coldfusion.flash.adapter.CFCAdapter</adapter> 
  <adapter>coldfusion.flash.adapter.CFSSASAdapter</adapter> 
  <!-- <adapter type="stateful-class">flashgateway.adapter.java.JavaBeanAdapter</adapter> --> 
  <!-- <adapter type="stateless-class">flashgateway.adapter.java.JavaAdapter</adapter> --> 
  <!-- <adapter type="ejb">flashgateway.adapter.java.EJBAdapter</adapter> --> 
  <!-- <adapter type="servlet">flashgateway.adapter.java.ServletAdapter</adapter> --> 
  <!-- <adapter>coldfusion.flash.adapter.CFWSAdapter</adapter> --> 
</service-adapters>

security

You can edit security settings in child tags of the <security> tag.

In the <login-command> tag, you can set the flashgateway.security.LoginCommand implementation for performing local authentication on a specific application server. By default, the <login-command> tag is set to the following values:

<login-command> 
  <class>flashgateway.security.JRunLoginCommand</class> 
  <server-match>JRun</server-match> 
</login-command>

In the <show-stacktraces> tag, you can enable stack traces. Stack traces are useful for debugging and product support, but they should not be sent to the client in production mode because they can expose internal information about the system. The following <show-stacktraces> tag is the default tag:

<show-stacktraces>false</show-stacktraces>

The <whitelist> tag specifies which remote sources can be accessed through the gateway. The * character can be used as a wildcard to imply ALL matches. The following <whitelist> tag shows the default value:

<whitelist> 
  <source>*</source> 
</whitelist>

When you deploy your application, ensure that you change this setting so that it specifies only the services that the gateway needs to access to run your application. Remember that for ColdFusion based services, directories are treated as "packages" and thus you specify a period delimited path from the web root to the directory or file containing the services you will allow access to. An asterisk wildcard allows access to all services in a particular directory. You can have multiple <source> tags.

The following whitelist allows access to the webroot/cfdocs/exampleapps/ directory, which includes the flash1 through flash5 Flash Remoting example directories. It also allows access to a webroot/BigApp/remoting directory and its children.

<whitelist> 
  <source>cfdocs.exampleapps.*</source> 
  <source>BigApp.remoting.*</source> 
</whitelist>

logger level

You can set the level of logging between None, Error, Info, Warning, and Debug. The following tag is the default logger level tag:

<logger level="Error">coldfusion.flash.ColdFusionLogger</logger>

redirect URL

In the <redirect-url> tag, you can specify a URL to receive HTTP requests that are not sent with AMF data. By default, the <redirect-url> tag is set to {context.root}, which is the context root of the web application:

<redirect-url>{context.root}</redirect-url>

case sensitivity

The <lowercase-keys> tag specifies how the gateway handles case sensitivity. ActionScript 1.0 and ColdFusion use case insensitive data structures to store associative arrays, objects and structs. The Java representation of these data types requires a case-insensitive Map, which the gateway achieves by forcing all keys to lowercase.

ActionScript 2.0 is case sensitive and requires a <lowercase-keys> tag value of false.

The following <lowercase-keys> tag is the default tag:

<lowercase-keys>true</lowercase-keys>