BlazeDS and ArrayList of custom objects

后端 未结 3 1714
余生分开走
余生分开走 2021-02-06 16:09

I\'m using BlazeDS to connect Flex with Java. I\'m having trouble passing ArrayLists of custom objects from Flex to java.

I have two objects, one is called Category,

3条回答
  •  天涯浪人
    2021-02-06 16:49

    the real answer is, that BlazeDS is stupid, and requires class reference to map your active script object back into Java (even if it just successfully mapped exactly the same object from Java to AS). I wasted quite some time on exactly the same problem today. I had quite a few similar mappings and they all worked fine, but today I created a new one, and it started to give me class cast exception.

    found an answer here: Link

    in your case solution would be:

    package mystuff
    {
        [RemoteClass(alias="mystuff.Section")] 
        public class Section
        {
            private var stupidBlazeDs : Category;
            public var categories:ArrayCollection;
        ...
        }
    }
    

    there might be better options but I had enough for today.

提交回复
热议问题