怎么实现啊?谁有例子啊?

解决方案 »

  1.   

    RemoteObject
    HttpService
    WebService
      

  2.   

    刚接触flex 不敢发表愚见 来拿分的 呵呵
      

  3.   

    flex是客户端的东西,没法用java调用,只能用js来操作
      

  4.   

    在remoting-config.xml中配置
    <?xml version="1.0" encoding="UTF-8"?>
    <service id="remoting-service" 
        class="flex.messaging.services.RemotingService">    <adapters>
            <adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/>
        </adapters>    <default-channels>
            <channel ref="my-amf"/>
        </default-channels>
        <destination id="testDAO">
          <properties>
             <source>com.test.dao.TestDAO</source><!--spring要注入的dao-->
          </properties>
        </destination>
    </service>
    前台在mxml中配置
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"  creationComplete="test.hello()" layout="absolute">
    <mx:RemoteObject id="test" destination="testDAO">
    </mx:RemoteObject>
    <mx:DataGrid id="dgStu" dataProvider="{test.hello.lastResult}" editable="true" verticalCenter="-5" horizontalCenter="-25">
    <mx:columns>
    <mx:DataGridColumn headerText="Column 1" dataField="name"/>
    <mx:DataGridColumn headerText="Column 2" dataField="age"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:Application>
      

  5.   

    4楼的你这个代码是flex调用java的吧