0

I have a collection of Objects in an ArrayCollection in my flex page.

What is the best approach to send this data to a Java Servlet?

The object in the ArrayCollection is a VO that consists of an id and message for now. I want a solution that is scalable in case more properties are added later on.

thanks in advance...

2
  • What's the data protocol on the servlet? JSON? XML? AMF? Commented Apr 29, 2011 at 13:24
  • I haven't decided on the Servlet code yet. Actually you just gave me some options to think about. XML seems quite easy to implement. How difficult it will be to parse JSON at servlet end? Commented Apr 29, 2011 at 13:28

1 Answer 1

3

"Best" is always subjective based on numerous factors.

My preference would be to use RemoteObject to access a backend service via an AMF Gateway. BlazeDS, LiveCycle Data Services, and GraniteDS are three java-based options for AMF gateways.

The AMF gateway will also give you automatic translation between the client side ActionScript object and a server side Java object.

The other alternatives for sending data from Flex to the server are to use HTTPService or WebService.

Sign up to request clarification or add additional context in comments.

2 Comments

thanks for the answer, but since i am looking for a light weight and faster implementation, can you give me an approach involving HTTPService. How to send an arraycollection over an HTTPService?
You'd have to quantify what "light weight" and "Faster" mean. Since RemoteObject is a binary format, it will provide smaller transfer size and faster communication time between client and server. To transfer an ArrayCollection over HTTPService, I'd convert it to XML and perform a POST. I feel that is a more complicated approach, though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.