最简单的flex+J2ee
运行环境是:
eclipse3.3+(我的是jee版本的)
安装flex builder3 plugin插件(FB3_WWEJ_Plugin.exe(google搜的到))
还要下载blazeds.war,解压也行,不解压也行。
OK。
下面创建flex-jee
新建一个flex project
输入名称,其他的不管,只选择application server type选择J2EE
next
选择你的tomcat
其他的不管,这个flex war file就是你的blazeds.war
OK,finish。
完成了。
现在在java src下面创建一个类:
package org.xlaohe1;public class T {public String s(String name) {return "Say: Hello!" + name;}}
<destination id="say"> <properties> <source>org.xlaohe1.T</source> </properties> </destination>
<?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"><mx:Script><![CDATA[import mx.rpc.events.ResultEvent;import mx.controls.Alert;import mx.rpc.events.FaultEvent;private function btnClick():void {sayRO.s(inputStr.text);}private function faultHandler(event:FaultEvent):void {ta.text = event.fault.toString();}private function sayHR(event:ResultEvent):void {ta.text = event.result.toString();}]]></mx:Script><mx:TextInput id="inputStr" x="24" y="40"/><mx:Button id="btn" click="btnClick();" x="209" y="40"/><mx:TextArea id="ta" x="24" y="99"/><mx:RemoteObject id="sayRO" destination="say" fault="faultHandler(event)"><mx:method name="s" result="sayHR(event)"/></mx:RemoteObject></mx:Application>