20.4. Configuring Flash Remoting for J2EE

Problem

You want to configure Flash Remoting for J2EE.

Solution

Copy the flashgateway.jar file into the web application’s WEB-INF/lib directory and configure a servlet and servlet-mapping in the web.xml file. If you use JRun 4 as your J2EE server, Flash Remoting comes preinstalled.

Discussion

If you are using JRun 4 as your J2EE server, Flash Remoting comes preinstalled and you do not need to purchase or configure any additional software. If you use a third-party J2EE server, such as IBM WebSphere or BEA Weblogic, the Flash Remoting for J2EE gateway, sold separately by Macromedia, allows Flash clients to communicate with Enterprise Java applications (see http://www.macromedia.com/software/flashremoting/productinfo/versions_pricing). If you are not using JRun 4, you must download and install either the trial version or full version before proceeding. (As an open source alternative, see the OpenAMF project at http://www.openamf.org.)

All the necessary code for Flash Remoting for J2EE is contained within the flashgateway.jar file. You can find this file in the Flash Remoting installation (on Windows machines this is typically under C:\Program Files\Macromedia\Flash Remoting MX). You can either extract the .jar file from the .war file (flashgateway-samples.war) or copy it from the sample application (within the sample\WEB-INF\lib subdirectory). You should copy this .jar file to the WEB-INF/lib directory of your own J2EE web application.

Once you ...

Get Actionscript Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.