Senthil Chidambaram

The soul...
The feeds...
The links...
Friday Aug 24, 2007

Flex 2.0 based web app on GlassFish

I was playing with Flex 2.0 user interface framework from Adobe to figure out how to develop a simple j2ee web app that can be deployed, and run on GlassFish out of the box. Along the way I learned about Flex Data Services, MXML etc. If you want to learn more about Flex you can always go to Adobe site for this. My intention here is to explain, and publish the simple Flex based j2ee app runs on GlassFish Application Server 9.1 without any code change on GlassFish server.

 In my webapp I wrote a simple mxml file which displays a form for the user to key in the input, this mxml file calls a jsp (catalog.jsp) which returns the result. At first I overlooked it, but seems to me that <mx:HTTPService> tag in Flex is very powerful. If you look at the SampleXML.mxml file, basically this tag does all the work.

You can download the war file from http://blogs.sun.com/cchidamb/resource/flex.war .I'm still working on deploying advanced Flex based J2EE apps on GlassFish, I'll update this blog later once I'm there.

 P.S: The attached war file has the web.xml, SampleXML.mxml, and catalog.jsp file. If you've the core flex libraries, you can repackage them with the downloaded war file, and deploy it on GlassFish which will work out of the box, due to size limitations to upload to this site, I couldn't upload the entire war file. Feel free to send me an email at cchidamb@sun.com if you need the entire app, I'll be happy to send it to you.