InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

FXStruts: Developing Flex-Friendly Struts Application

Posted by Moxie Zhang on Aug 04, 2008

Sections
Development
Topics
Java ,
Rich Internet Apps
Tags
Flex ,
Struts

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
  1. Back to top

    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 :-)

Educational Content

Attila Szegedi on JVM and GC Performance Tuning at Twitter

Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.

Interview: Software Systems Architecture: Working With Stakeholders Using Viewpoints and Perspectives

InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.

Beauty Is in the Eye of the Beholder

Alex Papadimoulis discusses ugly code, where it comes from, how to avoid it, and how to get rid of it.

Architecting Visa for Massive Scale and Continuous Innovation

John Davies examines Visa’s architecture and shows how enterprises have architected complex integrations incorporating Hadoop, memcached, Ruby on Rails, and others to deliver innovative solutions.

Max Protect: Scalability and Caching at ESPN.com

Sean Comerford unveils ESPN.com’s architecture, what components are used and why, and the current changes the website goes through.

The Seven Deadly Sins of Enterprise Agile Adoption

Are there repeated patterns of failure on Enterprise Agile Enablement efforts? Sanjiv and Arlen discuss Seven Deadly Sins to avoid when adopting Agile in an enterprise.

Questions for an Enterprise Architect

Erik Dörnenburg answers: What is Enterprise and Evolutionary Architecture?, discussing 4 issues: Turning strategy into execution, Ensuring conformance, Where do the architects sit? Buying or building?