8 Working with ColdFusion Applications

This chapter describes how to configure Coherence*Web for use with ColdFusion applications. ColdFusion is a rapid application development platform designed to make it easier to connect simple HTML pages to a database. ColdFusion applications can use Coherence*Web for session management regardless of whether the application server is running the SPI or non-SPI version of Coherence*Web.

This chapter contains the following sections:

8.1 Configuring Coherence*Web SPI for ColdFusion Applications

If your ColdFusion applications run on WebLogic Server, you can use Coherence*Web for session management. To enable the SPI version of Coherence*Web for ColdFusion applications running on the WebLogic Server:

  1. In the ColdFusion installer, create a WAR version of ColdFusion.

  2. Follow the provided instructions for configuring WebLogic Server for ColdFusion.

  3. Extract the WAR file into a directory for exploded directory deployment to WebLogic Server.

  4. Create a weblogic.xml file in the /WEB-INF directory of the exploded ColdFusion WAR file. Specify the Coherence SPI as a <library-ref> attribute.

    <?xml version="1.0"?>
    <weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
       <library-ref>
          <library-name>coherence-web-spi</library-name>
       </library-ref>
    </weblogic-web-app>
    
  5. Copy the coherence.jar file to the WEB-INF/lib directory of the exploded application.

  6. Copy the cfusion.jar file from the WEB-INF/cfusion/lib directory to the WEB-INF/ directory.

  7. Start the WebLogic Server instance. Deploy the Coherence*Web SPI to the WebLogic Server. The SPI is located at coherence\lib\coherence-web-spi.war in the Coherence distribution.

  8. Deploy the ColdFusion application to the WebLogic Server instance.

  9. Configure ColdFusion MX to use Java EE session management.

    1. Access the ColdFusion administration page at the following URL:

      http://<host>:<port>/coldfusion-context-root/CFIDE/administrator. 
      
    2. Select Memory Variables under Server Sessions and enable the Use Java EE session variables checkbox.

  10. Add your ColdFusion application under the exploded ColdFusion WAR file.

    The application must have an Application.cfm file that specifies sessionmanagement="Yes", but should not configure the session using ColdFusion configuration (otherwise, exceptions are thrown). The Application.cfm file should contain the following line:

    <cfapplication sessionmanagement="Yes">
    

8.2 Configuring Coherence*Web (non-SPI) for ColdFusion Applications

Note:

This section applies only to application servers that do not use the SPI version of Coherence*Web.

To enable the non-SPI version of Coherence*Web with for your application server.

  1. In the ColdFusion installer, create a WAR version of ColdFusion.

  2. Follow the provided instructions for configuring your Java EE container for ColdFusion.

    If you run Caucho Resin as your application server, run the Coherence*Web WebInstaller on the container. See "Installing on Caucho Resin 3.1.n" for more information.

  3. Instrument the generated cfusion.war file using the Coherence*Web WebInstaller.

    See "General Instructions for Installing Coherence*Web Session Management Module" for the additional steps to install Coherence*Web for a Java EE application.

  4. Deploy the cfusion.war file to the Web container.

  5. Configure ColdFusion MX to use Java EE session management:

    1. Access the ColdFusion administration page at the following URL:

      http://<host>:<port>/coldfusion-context-root/CFIDE/administrator
      
    2. Select Memory Variables under Server Sessions and enable the Use J2EE session variables check box.

  6. Add your ColdFusion application.

    The application must have an Application.cfm file that specifies sessionmanagement="Yes", but should not configure the session using ColdFusion configuration (otherwise, exceptions are thrown). The Application.cfm file should contain the following line:

    <cfapplication sessionmanagement="Yes">