Search code examples
apache-flexstruts

Using flex with struts


I have an old (around 5 years) enterprise application that I manage. Recently we got a go ahead for sprucing up the UI with flex. Keeping in mind that we want to utilize the current code base in struts (it's a fairly big application) , as I see it , I have three options:

  1. Flex BlazeDS
  2. Flex Tag Library
  3. FxStruts

BlazeDS is an open source and very efficient option when our entire application is in flex and we use our backend application just to provide service. But since the application is big , it's difficult to convert everything to flex.

Flex Tag Library is also an open source but was only developed for Flex 2 and no upgrade has been provided for Flex 3. And also it can create some performance issue if not used properly (or so I've read)

FxStruts is also an open source and can be used with any flex version. The biggest advantage is we don't have to change our server part and we can still utilize rich flex UI and we can still maintains our traditional UI for external clients where we may not use flex. It is basically a combination flex http service and blazeds serialization.

Which one might be better? Are there any other approaches? Eventually, we would also want to move towards spring/mvc or other framework. I do not want to get bitten by making an incorrect choice here.


Solution

  • With BlazeDS, you can easily expose your existing java services to the Flex client by configuring an xml file on the server. You can send and receive strongly typed objects (from ActionsScript to Java and vice versa) via both RMI and JMS. Just make sure your AS and Java classes have the same property names and types, register a class alias on the client and the Flash Player will do the rest.

    Working with Flex and BlazeDS is even simpler when you use the Spring BlazeDS Integration, assuming you are using Spring.

    You can also use the Spring ActionScript framework for dependency injection and an MVCS architecture in the Flex client. More info: http://www.herrodius.com/blog/160 (shameless plug)