File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Flex and the fly likes Flex and Java without BlazeDS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Flex
Bookmark "Flex and Java without BlazeDS" Watch "Flex and Java without BlazeDS" New topic
Author

Flex and Java without BlazeDS

Rory Thomas
Greenhorn

Joined: Apr 17, 2008
Posts: 27
Hi Satish,

I am relatively new to Flex, with about 18 months of Java. As I get started with trying to connect Java and Flex, I want to avoid having to learn BlazeDS at the same time. Is this easily done, or am I trying to do something the "easy way", which is in fact the harder way?

Another major concern is that my web host will likely not allow me run BlazeDS on a shared server, so I would prefer to work with Flex and Servlets only. I have been looking for a resource on this topic, hoping your book may be it!

Thanks,
Rory


SCJP February 2010, SCJA June 2008
Rj Salicco
Greenhorn

Joined: Apr 14, 2009
Posts: 17
Rory,

I have found great success with Grails and Flex. I basically rely on RESTful services, rendering XML, created in my Grails application and I use mx:HTTPService with a result type of "e4x" to handle the XML returned. But you can easily do this with Servlets and you could also use a JSR 311 JAX-RS implementation to achieve similar RESTful services. BlazeDS is nice and it does offer a bit more features, but RESTful XML services will also allow you to change your UI technology if you need to.


-RJ
http://www.rjsalicco.com
Satish Kore
Author
Ranch Hand

Joined: Feb 10, 2004
Posts: 43
Hi Rory,

You don't need BlazeDS as long as you don't use messaging, Push or anything that requires AMF. So the simple approach as suggested by RJ use XML based request and response through HttpService method.

Or if you need to send and receive objects instead of XML then I suggest you to use JSON along with Flex HttpService. e.g. Have a JSP/Servlet that generates JSON object and send it back to Flex, on Flex side use AS3CoreLib (http://code.google.com/p/as3corelib/) to decode/encode JSON objects.

Thanks,

Satish Kore
"Flex 3 with Java" @ packtpub.com and amazon.com
Satish Kore
Author
Ranch Hand

Joined: Feb 10, 2004
Posts: 43
Rory Thomas wrote:
Another major concern is that my web host will likely not allow me run BlazeDS on a shared server, so I would prefer to work with Flex and Servlets only. I have been looking for a resource on this topic, hoping your book may be it!


BlazeDS is just bunch of Java libraries (.jar) and configuration (.xml) files so if you server allows you to run J2EE apps your should be good to host BlazeDS based application as well.

Thanks,
Satish
Rory Thomas
Greenhorn

Joined: Apr 17, 2008
Posts: 27
Thanks Satish, and RJ as well.

I have found my host to particularly painful about this stuff (runs Struts 1, but not Struts 2 for example). However, maybe it's my issue!

I have used some JSON, so I will look into that option as well. Thanks for the advice, I look forward to checking out the book further.

Thanks,
Rory
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Flex and Java without BlazeDS