hide side navigation
    5 most recent
    Web Services
    Library's
    Component's
    Applications
    Articles
  Flash button as Flex icon  Flex form by email  Hello Remoting with AS3  AS3 Saving data from Flash  AS3 Loading data into Flash  Fire Effect  Contact form  Dragable buttons  Hello World with openamf  Loading helper classes  Upload with Flash 8  Transitions effects  Snapshot with Flash 8  Hello World Remoting AS2  Flash AS2 Remoting Connector  Saving data from Flash  Loading data into Flash  FlashCom & Remoting login  Cell Renderer API  Editing a table using remoting components  Flash MX2004 web service classes  Browsing a catalog  amfphp Documentation  Hello World Remoting  Online Store with AMFPHP  Flash clients for Web Services  Web Service Walk Though with NuSoap  Popup windows in flash with javascript  Installing Apache/PHP  MoreOver News Feeds  Load Edit Save Text Files via CGI  Save Movie Clip Postion via PHP and MySQL
Current Page (1) Next Page >>  View Article Example >> 1 | 2 | 3 | 4

Installing Flash Remoting for Java (aka openamf)

This tutorial assume you have Tomcat and the needed jdk installed, if not follow Tomcat installation instructions

Next install the Flash remoting components. The components include the classes you need to connect to Flash remoting, and also debugging and formatting classes that will help out when developing.

Next download the current version of OPENAMF from http://sourceforge.net/projects/openamf/

After you have downloaded the current version of OPENAMF unzip them and take a look at the files. You will see many folders, but three main files that can be used immediately: openamf.war for Tomcat deployment , openamf.jar to add the library to your own application and openamf.ear used for J2EE deployment, but not supported by Tomcat . Other folders contains source code, examples and javadocs to inspect classes. Since the README quick start ask to drop the war file in the webapps folder and start your server, sometimes gives some error and probably will not start in Tomcat. So having download all the pieces, let's go over the HelloWorld example in Tomcat.

 

Tomcat Hello World

Tomcat will look for applications in webapps directory (or those specified in catalina folder) and will start any servlet needed for them. This means that some of them could fails for any reason and the application won't start, so it's important to look at the startup screen or check the logs for possible errors in the startup process. If you get no errors, then your application start ok and that's our goal for our Hello World example. In sake of simplicity, let's use webapps folder for our stuff.

Locate your Tomcat directory and the webapps folder inside it and create

Ok, this is our base folder structure that any web application should adhere based on Sun guidelines. Inside classes folder will be the source and compiled code for our classes, and inside lib any external library that we need (usually as jar file) including of course the openamf.jar. Since we need all of them, unzip the openamf file if you didn't do yet, and copy this files from the unzipped openamf distribution:

In our simple example we don't need all of the jar files, but documentation is not clear about which one we can skip, so we just copy all the content

Ok, we have the needed external classes and the folder structure, but Tomcat needs also additional information to map servlet resources (the gateway) in our application, so let's create a file named web.xml with the following content:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
<web-app>
    <servlet>
        <servlet-name>DefaultGateway</servlet-name>
        <display-name>DefaultGateway</display-name>
        <description>DefaultGateway</description>
        <servlet-class>org.openamf.DefaultGateway</servlet-class>
        <init-param>
            <param-name>OPENAMF_CONFIG</param-name>
            <param-value>/WEB-INF/openamf-config.xml</param-value>
            <description>Location of the OpenAMF config file.</description>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>DefaultGateway</servlet-name>
        <url-pattern>/gateway</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>30</session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>
</web-app>

Save this file to Tomcat helloworld/WEB-INF/ and we are almost done with the structure ... but wait, we need also to write the helloWorld class and Flash client, so le's go to the next task

 

Current Page (1) Next Page >> 1 | 2 | 3 | 4