Flex可变参数带来的问题 博客分类: Flex/BlazeDS 可变参数variableparameter
程序员文章站
2024-02-04 12:43:04
...
当你在flex的方法中用了可变参数后,你会发现这些参数传到java端后出现意想不到的情况,即flex会自动把你的实际参数封装到一个Array里面去,这样就会导致问题,如flex/java端取不到参数的值
override public function call(methodName:String, ... parameters):IOperation {
Assert.state(remoteObject != null, "The remoteObject property must not be null");
return new RemoteObjectOperation(remoteObject, methodName, parameters);
}
Here what need you attention is that the parameters will automatically encapsulate into an array, like your passed parameter is an object, it will go this way: [object], if you passed an array:[1,2,3], it will go this way:[[1,2,3]], so it may result in blazeds not finding the right java side method because of the parameter type changing.
override public function call(methodName:String, ... parameters):IOperation {
Assert.state(remoteObject != null, "The remoteObject property must not be null");
return new RemoteObjectOperation(remoteObject, methodName, parameters);
}
Here what need you attention is that the parameters will automatically encapsulate into an array, like your passed parameter is an object, it will go this way: [object], if you passed an array:[1,2,3], it will go this way:[[1,2,3]], so it may result in blazeds not finding the right java side method because of the parameter type changing.
上一篇: 百度大战QQ 博客分类: 生活 百度QQ
下一篇: 使用shell来发tcp包的方法