InfoQ

News

FXStruts: Developing Flex-Friendly Struts Application

Posted by Moxie Zhang on Aug 04, 2008 08:20 AM

Community
Java
Topics
Rich Internet Apps
Tags
Struts ,
Flex

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.

Enjoy? by Stefan Tilkov Posted Aug 5, 2008 2:08 AM
  1. Back to top

    Enjoy?

    Aug 5, 2008 2:08 AM 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 :-)

Educational Content

Bindings, Platforms, and Innovation

This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.

Orchestrating Long Running Activities with JBoss / JBPM

This article explores the use of JBoss and jBPM to implement design solutions that effectively address the issue of orchestrating long running activities.

Neo4j - The Benefits of Graph Databases

This presentation covers the use of graph databases as an optimal solution for data that is difficult to fit in static tables, rapidly evolving data or data that has a lot of optional attributes.

Realistic about Risk: Software development with Real Options

This session introduces Real Options and shows how it can help in running your project. Real Options is a decision-making process that can be used to manage risk.

Communication Flexibility Using Bindings

This article discusses the use of bindings on services and references (including the instance of non-configured bindings) as the means to implement SCA communications in a Web and SOA environment.

Writing DSLs in Groovy

After a short introduction to DSLs, Scott Davis plays with the keyboard showing how to approach the creation of a DSL by typing working snippets of Groovy code that get executed.

Scaling Agile with C/ALM (Collaborative Application Lifecycle Management)

IBM Rational and InfoQ present, Scaling Agile with C/ALM, an eBook showing organizations how to become “finely tuned software delivery machines” by enabling team integration and scaling.

Concurrent Programming with Microsoft F#

Amanda Laucher presents a real life enterprise application written in F#. She shows actual code snippets, explaining design decisions and suggesting how to use some of the F# constructs.