Saturday, 20 January 2007

Installing Flex on Coldfusion

Coldfusion mx7 flex


In this post we will discuss how to install flex on Coldfusion server. I have installed flex on Windows XP and with the built in server for Coldfusion MX7 (Developer edition). For more information and installing flex samples, please read article on Adobe’s website http://www.adobe.com/support/documentation/en/flex/1_5/flexforcf.html).

Download the latest version of Flex installer from http://www.adobe.com/products/flex/

Now run the installer to extract/copy Flex files to flex install directory.

Copy flex.war from flex install directory, create temp folder (for example c:/tempflexwar), and extract the content using Winzip or other similar extractor.

Now stop Coldfusion server and carefully follow all the steps.
Copy content from the WEB-INF folder of the c:/tempflexwar/flex to the {Coldfusion root directory}/ WEB-INF
Make sure that you copy content from c:/tempflexwar/flex/WEB-INF/lib to {Coldfusion root directory}/ WEB-INF/ lib, c:/tempflexwar/flex/WEB-INF/classes to {Coldfusion root directory}/ WEB-INF/classes and c:/tempflexwar/flex/WEB-INF/flex to {Coldfusion root directory}/ WEB-INF/flex (if you don’t have folder called flex just create one or copy content.

Now you need to merge Flex web.xml file to Coldfusion web.xml file.

[Note: Its always a good idea to make a copy of original file.]

Open Coldfusion web.xml in text editor or in Dreamweaver. You can find web.xml file in {Coldfusion root directory}/ WEB-INF/ folder.
Replace the “Doctype” definition 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">

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

Copy the context parameters, filters, filter mappings, listeners, and servlet definitions from the Flex web.xml file to the appropriate sections in the ColdFusion MX web.xml file. Copy each of these elements to the end of the matching section in the ColdFusion MX configuration file. For example, when copying the Flex filter mappings, add them after the ColdFusion MX filters mappings but before the next set of elements. Be sure to maintain the order of the XML blocks in the way that they appear in the Flex web.xml file.

Save the web.xml and restart coldfusion server.

If all the steps are followed properly you should be able to compile mxml file in your coldfusion instance.

If for any reason it doen't work, stop your coldfusion server and check the web.xml file.

All the best.

0 comments: