• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Communication between Java Servlet and Flash

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear programming friends,

I have made an jsp/servlet application to manage appointments.

As an extra:
I am making a FLEX (flash) interface In Adobe flash builder, to manage these appointments with drag and drop functions etc..
But I have a problem: Is it possible to communicate in flash with java Servlets?

Maybe I have to export all my arraylists and parameters to arraycollections in flex (So I can build up my flash website with imported arraylists), or is there an easier way?

When I would make an appointment in flash, my servlet requires some parameters, is it possible to send them through?

I hope someone can help me, I have been googling this for hours. I haven't found a solution yet.
There was an earlier topic about this on javaranch, but the URL links they gave to help the guy out are all dead right now :'(

 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you looked at the mx:HTTPService tag?

Personally I would probably go with a RESTful web service on the Java side, but it is possible to interface with your existing web application if you must.
 
Andrew Monkhouse
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Assuming you are running the Flex app directly on top of the existing web application without adding a REST interface, here is some very simplistic code showing calling a web application through Flex:



Since you control the server, you can probably make sure the output is well formed XML, which would allow you to set the resultFormat to e4x and process it as an XML document.

The important thing is the answer to your question - you can see that on line 5 I am declaring a call to the HTTPService provided by Bing (because it is shorter to type than Google ) at http://www.bing.com/search. Then I pass the parameter "q" with the value "cheese" at line 7.
 
Rob Proesmans
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok thank you man, so you suggest to export the data from the servlet (arraylists with objects in it) to XML.
And then import XML to Flex, is this the proper way to do it?
 
Andrew Monkhouse
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might be interested in Flex chart from XML data using HttpService with Java Servlets - while the servlet code is pretty ugly, the overall concept shows what you need.
 
Wanna see my flashlight? How about this tiny ad?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic