Accessibility
Adobe
Sign in Privacy My Adobe

Flex Documentation

Installing Flex on ColdFusion MX

This document contains instructions on installing the Macromedia Flex 1.5 application and the Flex sample applications on ColdFusion MX, as described in the following sections:

Overview

You can install Macromedia Flex with the J2EE version of ColdFusion MX so that your ColdFusion applications can use MXML tags and serve MXML pages. You can also embed the Flex custom tag library in ColdFusion pages.

Note: To run Flex, your application server must be listed as a supported server in the Flex 1.5 Installation Instructions. Not all application servers that run ColdFusion MX can also run Flex.

These instructions describe how to extract the contents of the following Flex WAR files and add them to your ColdFusion installation so that you can write Flex applications and run the Flex samples:

  • flex.war — The primary Flex WAR file.
  • samples.war — Example Flex applications.

Each Flex WAR file is a separate, stand-alone application. Do not install the samples.war file in the same ColdFusion instance directory as the flex.war file. Instead, install it in a separate ColdFusion instance on your server with its own directory structure and context root.

Flex and ColdFusion MX provide their services through servlets. These servlets are deployed through the web application deployment descriptors (web.xml). Flex and ColdFusion each have their own class loading mechanism. They load their classes from specific classpaths instead of the application server's environment classpaths.

Installing the flex.war file on ColdFusion MX

This section describes how to integrate the Flex and ColdFusion MX web.xml files into a single deployment descriptor so that Flex runs within a ColdFusion MX application. After you complete this procedure, you can copy MXML pages to your ColdFusion application directory and make requests to them just as you can to CFM pages.

To install the flex.war file on ColdFusion MX:

  1. Run the Flex installer to copy the Flex files to your flex_install_dir directory (for example, C:\Program Files\Macromedia\Flex\). For more information, see the Flex 1.5 Installation Instructions.
  2. Extract the contents of the flex_install_dir\flex.war file to a temporary directory (such as C:\temp\flextemp\) using WinZip or another archiving utility.
  3. Stop your ColdFusion server.
  4. Copy the \flex subdirectory from the flextemp\flex\WEB-INF directory to the ColdFusion MX cf_server_root\WEB-INF directory.

    Note: Copy only the flextemp\flex\WEB-INF\flex directory to the ColdFusion MX environment in this step. You merge the Flex web.xml file and the ColdFusion MX web.xml file in later steps.

  5. Copy the following files from the flextemp\flex\WEB-INF\lib directory to the ColdFusion MX cf_server_root\WEB-INF\lib directory:
    • flex-bootstrap.jar
    • commons-beanutils.jar
    • commons-collections.jar
    • flashgateway.jar files
  6. Copy all assets required by your Flex application into the root directory of your deployed ColdFusion server instance. For example, if you deployed ColdFusion on JRun 4, the root directory of your deployed ColdFusion server instance might be C:\JRun4\servers\default\cfusion.
  7. Merge the Flex web.xml file with the ColdFusion MX web.xml file by doing the following:
    1. Open the ColdFusion web.xml file from the directory cf_server_root\WEB-INF.
    2. Replace the DOCTYPE definition at the top of the ColdFusion MX web.xml file with the following DOCTYPE definition:

      <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.// DTD Web Application 2.3// EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

      The latest web-app DTD includes support for servlet filters, which ColdFusion MX does not include by default.

      Note: Not all application servers support the 2.3 Servlet API. For more information, see the documentation for your application server.

    3. Copy the context parameters, filters, filter mappings, servlet definitions, servlet mappings, error page mappings, tag library definitions, and all other definitions from the Flex web.xml file to the appropriate sections, and in the appropriate order, to the ColdFusion MX web.xml file. You can determine the appropriate order by looking at the DTD document that you specified in the DOCTYPE definition in Step 7b.

      For example, that DTD specifies the following order that the tags must have in order for the document to be considered a valid XML document:

      <!ELEMENT web-app (icon?, display-name?, description?, distributable?, context-param*, filter*, filter-mapping*, listener*, servlet*, servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?, error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*, login-config?, security-role*, env-entry*, ejb-ref*, ejb-local-ref*)>

  8. Save the ColdFusion MX web.xml file and restart your ColdFusion MX server.

Note: If you are using ColdFusion with a web server, please see the technote at http://www.macromedia.com/support/flex/ts/documents/slash_contextroot.htm for information about adding web server mappings.

Installing the Flex samples on ColdFusion MX

This section describes how to install the Flex samples on ColdFusion MX. It assumes that you have already extracted the samples.war file from the Flex download using the instructions in Installing the flex.war file on ColdFusion MX.

If you have already installed the flex.war file on a ColdFusion MX server instance, you should create another ColdFusion MX server instance for the Flex samples.

The instructions in this section involve merging Flex and ColdFusion configuration files. When you merge files, copy each of the elements from the Flex configuration file to the end of the matching section in the ColdFusion MX configuration file. For example, when you copy the Flex filter mappings, add them after the ColdFusion MX filter mappings but before the next set of elements. Be sure to maintain the order of the XML blocks as they appear in the Flex samples configuration files.

Note: Do not copy the SamplesAxisServlet servlet and SamplesAxisServlet servlet mapping when you merge the Flex samples and ColdFusion MX web.xml files. Also, do not copy the AdminService service when you merge the server-config.wsdd files.

To install the Flex samples on ColdFusion MX:

  1. Extract the contents of the flex_install_dir\samples.war file to a temporary directory (such as C:\temp\samplestemp) using WinZip or another archiving utility.
  2. Stop your ColdFusion server.
  3. Copy the \flex subdirectory from the samplestemp\WEB-INF directory to the ColdFusion MX cf_server_root\WEB-INF directory.

    Note: Do not copy the Flex web.xml file or resources other than the samplestemp\WEB-INF\flex directory to ColdFusion in this step. You will merge the samples web.xml file and the ColdFusion MX web.xml files in later steps.

  4. From the samplestemp directory, copy the following folders and files to the cf_server_root directory. For example, if you deployed ColdFusion on JRun 4, the root directory of your deployed ColdFusion server instance might be C:\JRun4\servers\default\cfusionsamples.
    • blogreader folder
    • dataModel folder
    • explorer folder
    • flexstore folder
    • occ folder
    • photoviewer folder
    • reskinnedOcc folder
    • rsl folder
    • index.htm file
    • xd.css file
  5. Copy all files from the samplestemp\WEB-INF\lib directory to the ColdFusion cf_server_root\WEB-INF\lib directory.
  6. Copy the samples folder from the samplestemp\WEB-INF\classes directory to the ColdFusion cf_server_root\WEB-INF\classes directory.
  7. Merge the Flex samples samplestemp\WEB-INF\web.xml file with the ColdFusion cf_server_root\WEB-INF\web.xml file by doing the following:
    1. Open the ColdFusion web.xml file.
    2. Replace the DOCTYPE definition at the top of the ColdFusion web.xml file with the following DOCTYPE definition:

      <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

    3. Copy the display name, description, context parameters, filters, filter mappings, servlet definitions, servlet mappings, error page mappings, tag library definitions, and other definitions from the Flex web.xml file to the appropriate sections in the appropriate order in the ColdFusion MX web.xml file. You can determine the appropriate order by looking at the DTD document specified in the DOCTYPE definition that you replaced in Step 7b.

      For example, that DTD specifies the following order that the tags must have in order for the document to be considered a valid XML document:

      <!ELEMENT web-app (icon?, display-name?, description?, distributable?, context-param*, filter*, filter-mapping*, listener*, servlet*, servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?, error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*, login-config?, security-role*, env-entry*, ejb-ref*, ejb-local-ref*)>

      Note: Do not copy the SamplesAxisServlet servlet definition or servlet mapping.

    1. Save the ColdFusion web.xml file.
  8. Merge the Flex samples server-config.wsdd file with the ColdFusion server-config.wsdd file by doing the following:
    1. Open the cf_server_root\WEB-INF\server-config.wsdd file.
    2. Copy all the services, except the Flex AdminService service, from the samplestemp\WEB-INF\server-config.wsdd file to the cf_server_root\WEB-INF\server-config.wsdd file, directly below the beanMapping service.
    3. Save the ColdFusion server-config.wsdd file.
  9. Start your ColdFusion server.
  10. Request the Flex samples using a URL in the following form:
    http://hostname:portnumber/context-root/index.htm

    For example, if the context root of your ColdFusion application is /cfusionsamples, you might use:

    http://localhost:8100/cfusionsamples/index.htm

Getting Started

 

Application Development

 

Security

 

Downloads

 

Documentation

 

Community Resources