The steps to build flex and Java Communication framework

Source: Internet
Author: User
Tags config

Flex and Java Communication Framework to build the steps:

1. Create a new Web project and start Tomcat run to check that everything is ok (required);

2. Import the required jar pack (which I have given), Copy and paste the four XML resource files you want: Messaging-config.xml,proxy-config.xml,remoting-config.xml,services-config.xml to the Web-inf folder of your project, as shown in the following illustration:

3. Modify the Web.xml file: Paste the following content into the Web.xml, do not need to make any changes;

Flex.class.path

/web-inf/flex/hotfixes,/web-inf/flex/jars

Flex.messaging.HttpFlexSession

Messagebrokerservlet

Flex.messaging.MessageBrokerServlet

Services.configuration.file

/web-inf/flex/services-config.xml

1

Messagebrokerservlet

/messagebroker/*

4. Add Flex project support and publish the Web project (required), as shown in the following figure:

----↓↓

Note: must follow the above diagram to do, otherwise it is difficult to configure the success!

5. New class Firstflex in this project

public class Firstflex {

public string Hello (string name) {

Return "Hello!" + name;

}

}

6. and add the following code to the Remoting-config.xml: Configure the class

Com.alex.flex.FirstFlex

7. Modify Flex-compiled version, or you cannot generate SWF. (Project Right click, select Properties)

8. Invoke Java processing class in Mxml

  

Import mx.rpc.events.ResultEvent;

function Rest (event:resultevent): void {

Rest_ta.text = Event.result as String;

}

function Remotingsayhello (): void {

H.hello (Inp.text);

}

]]>

Exposed objects

9. When the server is started, the project will automatically publish the Flex directory and SWF to WebApps.

10. Hey, you can see, simple flex and Java communication has been successful!

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.