BT
x Your opinion matters! Please fill in the InfoQ Survey about your reading habits!

FXStruts: Developing Flex-Friendly Struts Application

by Moxie Zhang on Aug 04, 2008 |

Struts is a Java framework based on standard Java technologies, such as Java Servlet, JavaBean, ResourceBundles and XML. Java developers have been enjoying Struts as a solid server side framework for many years. Recently, a technical evangelist for Adobe Systems, Anirudh Sasikumar, developed a new solution by integrating Flex as Struts' front end. Sasikumar calls it FxStruts.

According to Sasikumar:

FxStruts is a free open source library that provides the same functionality as bean:write except that the output is in AMF or XML format. Simply point it to any plain Java object and you get Flex friendly AMF or XML output with ActionErrors and transaction token support.

Sasikumar was motivated to develop FxStruts, owing to the complexity involved in developing Web applications. He notes:

Web application development is tricky business. You start off with simple JSPs and after a while your Web application is tag soup: a mix mash of JSP tags, HTML markup and server side code. You slowly realize there has to be a cleaner way of doing this. This is where you finally read about MVC, Struts, Spring, and so fort and get blown away!

FxStruts is created to solve a problem that arises when you switch the MVC application's view to Flex. As Saikumark says, “Once you change your view layer to Flex, it is harder to get data from your model while using Struts. FxStruts was developed to make this part really easy.

Saikumark demonstrates FxStruts with a Struts MailReader application that has been modified to have a Flex user interface (UI) without any changes to the Action classes. The only changes made were the addition of new JSPs and the mappings in struts-config.xml.

For people interested in FxStruts, it is hosted on Google Code and has two pieces: the taglib piece licensed under the ASL 2.0 and the AMF / XML serialization part1 licensed under the LGPL 3.0. The Flex component, HTTPAMFService, is licensed under the MPL 1.1.

The Flex version of the struts mailreader application (WAR) is available at Google Code along with a walking tour, highlighting the steps involved in developing a full-fledged Flex application on top of Struts. Documentation on installation and how to migrate an existing Struts application to Flex is also available.

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Enjoy? by Stefan Tilkov

Java developers have been enjoying Struts as a solid server side framework for many years.


I just started bleeding out of my eyes :-)

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

1 Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT