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.

Thursday Aug 02, 2007

glassfish 9.1 admin-console (admingui) logout issue

We see users experiencing the header.jsf (masthead frame) is being occupied in the whole admin-console window when logout button is clicked. Not only the masthead frame occupies the whole window, logout never happened, meaning session was not terminated. We found out a work around for this, hopefully we'll provide a fix in the update releases. The issue here is by default JSF caches up to 15 views, meaning when you go to 15 different screens, and click logout it redirects to the same page, where the request has come from, in this case masthead (header.jsf). To fix this as an workaround you can add the following entries in your web.xml under <INSTALL_ROOT>/lib/install/applications/admingui/adminGUI_war/WEB-INF

 <context-param>
        <param-name>com.sun.faces.numberOfViewsInSession</param-name>
        <param-value>100</param-value>
    </context-param>