安装应该都没问题,现在问题是我写了flex程序,再在里面加入java程序,并且编译成功,看到class文件了,并且发布成功了,首先remoting-config.xml我设置了,其次输入相应的地址我能看到我的网页,但是点击了按钮就是没有反应,理论上应该有显示,就连错误也没有,有木有高手帮忙解决下,万分感激,已经好几天了
附上部分我的代码
java处理
package hello;
public class HelloWorld {
public String sayHelloTo(String str) {
System.out.println("Hello " + str);
return "Hello " + str; }
}flex页面
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" viewSourceURL="srcview/index.html">
<mx:Script>
<![CDATA[ import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
[Bindable]
private var helloResult:String;
private function sayHelloTo():void {
ro.sayHelloTo(inputText.text);
}
private function resultHandler(event:ResultEvent):void {
helloResult = event.result as String;
} ]]> </mx:Script>
<mx:RemoteObject id="ro" destination="HelloWorld" result="resultHandler(event)" endpoint="http://localhost:8080/chs_flex/messagebroker/amf" />
<mx:HBox width="100%">
<mx:TextInput id="inputText"/>
<mx:Button label="Submit" click="sayHelloTo()"/>
</mx:HBox>
<mx:Label text="{helloResult}"/>
</mx:Application>
附上部分我的代码
java处理
package hello;
public class HelloWorld {
public String sayHelloTo(String str) {
System.out.println("Hello " + str);
return "Hello " + str; }
}flex页面
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" viewSourceURL="srcview/index.html">
<mx:Script>
<![CDATA[ import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
[Bindable]
private var helloResult:String;
private function sayHelloTo():void {
ro.sayHelloTo(inputText.text);
}
private function resultHandler(event:ResultEvent):void {
helloResult = event.result as String;
} ]]> </mx:Script>
<mx:RemoteObject id="ro" destination="HelloWorld" result="resultHandler(event)" endpoint="http://localhost:8080/chs_flex/messagebroker/amf" />
<mx:HBox width="100%">
<mx:TextInput id="inputText"/>
<mx:Button label="Submit" click="sayHelloTo()"/>
</mx:HBox>
<mx:Label text="{helloResult}"/>
</mx:Application>
flex也是一种框架,百度下会找到很多说明的。