I have an arraylist of custom object in servlet end. I want to send it back to flex end as custom marshaling through BlazeDs (as my web project holds blazeDS settings) so flex end can get ArrayCollection objects. How do I do that? I can get String or json arrays, but I dont want that, what I want is custom marshaled object thorugh blaze DS, how do I do that?
Asked
Active
Viewed 211 times
-1
-
Use RemoteObject through your BlazeDS AMF Gateway – JeffryHouser May 09 '13 at 13:59
-
I used remote object for sending flex object to java end and it worked fine, but when I send java object to flex end it only receives object type as string. – Robert Smith May 10 '13 at 03:53
-
That is unexpected; are you sending back a string or an object? I think you'lll need to share some code on the Java side to show how you are returning values. – JeffryHouser May 10 '13 at 09:43
-
PrintWriter out = response.getWriter(); ASTranslator ast = new ASTranslator(); out.print(ast.convert(ObjSalesReview, flex.messaging.io.ArrayCollection.class)); out.flush(); [ObjSalesReview is arraylist containing custom object] – Robert Smith May 10 '13 at 10:24
-
Edit your question and add the code to your question. Code in comments is hard to read. Doesn't Java have the concept of a "return" like ActionScript does? I assume you have to 'return' your object. I also assume that "out.print" and "out.flush" are used for displaying data--such as to a console or a web page--not for returning values from a method. [I'm not a Java expert, though] – JeffryHouser May 10 '13 at 13:15
1 Answers
0
Use [RemoteClass(alias="")] metadata tag to represent server-side Java Object at flex end. The same question is asked and perfectly answered at this link.
How does [RemoteClass] work in Flex Actionscript can I use it for custom data-binding?
-
this was already written [Bindable] [RemoteClass(alias="com.rit.subarubmwebjava.vo.SalesReviewOneAnswerVO")] – Robert Smith May 10 '13 at 11:41