Here's a way to implement Java and Flex communications using BlazeDS
BlazeDS is a server-based Java remote control (remoting) and Web messaging (messaging) technology that enables back-end Java applications to communicate with Adobe Flex applications running on browsers.
1. Development Preparation
1. Install JDK and Tomcat and implement a successful configuration.
2. Install the Flex SDK. See the official documentation for details
3. Download BlazeDS, if you are using the turnkey version (recommended to download this version) inside actually contains the TOMCAT server.
I'm using myeclipse8.5, Flash Builder 4.
2, first build Java engineering Flexdemo, and import blazeds
Click OK, and then select the BlazeDS check box that you imported in
Click Finish to complete.
3, configure the Tomcat server, deploy the application, and start the service.
4, open the Flash Builder4 client, create Flex project Flex4demo
Click Next to enter the Java server Configuration entry, configured as follows:
Click Next to enter the Flex project build path option
Click Finish.
5. Back to MyEclipse editor, create HelloService class, add SayHello () method.
6. Configure Remote service target (webroot/web-inf/flex/remoting-config.xml)
7, back to the Flash Builder4 editor Mxml write the following code:
8, running Flex applications, you can:
Ok! the first instance of Flex and Java communication is complete.