flex Cairgorm与J2EE实现的登录及问题

来源:互联网 发布:玩客云自动抢购软件 编辑:程序博客网 时间:2024/05/17 03:12
 
源码结构如上,遇到的主要问题有:
1144: 接口方法 onResult (位于命名空间 com.adobe.cairngorm.business:Responder 中)是通过类
 business.commands:LoginCommand 中不兼容的签名实现的。---经检查发现com.adobe.cairngorm.business.Responder 的Responder接口中函数及参数为onResult(event:*=null),,onFault(event:*=null),参数必须为event:*=null。
在delegate包里的文件以及commands包的文件中在使用Responder时要注意:
Respoder接口有2个:一个是com.adobe.cairngorm.business.Responder 这个,一个是mx.rpc.IResponder。对于第一个,在command文件里继承此接口时,对应的函数为onResult(event:*=null),,onFault(event:*=null),并且在services.mxml中需加入如下
红色部分

services.mxml

<?xml version="1.0" encoding="utf-8"?> 
<rds:ServiceLocator xmlns:rds="com.adobe.cairngorm.business.*"   
     xmlns:mx="http://www.adobe.com/2006/mxml"> 
 <mx:RemoteObject   
  id="userService"   
  destination="userServiceDestination"   
  endpoint="http://localhost:8080/FlexCairngorm2/messagebroker/amf"
  showBusyCursor="true"
  result="event.token.resultHandler( event );"
  fault="event.token.faultHandler( event );"> 
 </mx:RemoteObject> 
</rds:ServiceLocator> 
对于第二个,command在继承接口时,需实现函数result,fault,参数可以为event:Object,
两种方法均是通过event.result获取返回的数据。
在view中需要显示的数据均要在ModelLocator中有定义以及初始化。,可以建立多个modelLocator,或一个结合多个Model