*** 6/8 UPDATE:  We have now added Flex Scaffolding in MyEclipse for Spring 8.6!!  Create an entire Spring Flex CRUD app in a matter of seconds.  Try it by downloading the 8.6 milestone. Check out the what's generated blog or the getting started video.

UPDATES: This blog has been updated for MyEclipse for Spring 8.5, Spring 3.0, and Flash Builder 4.  If you are looking for the previous version that includes the MyEclipse for Spring milestone, Spring 2.5, and Flex Builder 3, download the archived pdf.

In Part 1 of this example, I covered prerequisites, project creation and setup, and scaffolding in MyEclipse for Spring.  In Part 2, I will discuss adding the necessary pieces to get a Spring application Flex enabled through BlazeDS remoting.

This blog is divided into 2 parts:


  1. Add the messagebroker servlet mapping: Insert the following code where the servlet mappings are defined.  This mapping is used by the Flex remoting object.
        <servlet-name>ClassicFlexCars Servlet</servlet-name>
  2. Add the flex context file: Find where the ClassicFlexCars Servlet is defined.  In the param-value element for the contextConfigLocation, add /WEB-INF/flex-servlet.xml.  So the resulting servlet block should look like:
        <servlet-name>ClassicFlexCars Servlet</servlet-name>


  1. Add a file, named flex-servlet.xml, to the ClassicFlexCars > WebRoot/WEB-INF folder with the following contents:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
         <!-- Expose the ProductService bean for BlazeDS remoting -->
         <flex:remoting-destination ref="ProductService" />


  1. When adding the Flex Project Type, it adds a handful of files to the WebRoot/WEB-INF/flex folder.  Feel free to use whatever Flex provides.  However, to just get remoting up and running on a channel, all you need in the services-config.xml file is the following:
    <?xml version="1.0" encoding="UTF-8"?>
                <channel ref="my-amf"/>
            <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">

    NOTE: Anytime this file is udpated or modified, you'll want to force a recompile of the swf file. These configurations are compiled into the flash file.

Add the spring-flex jar

  1. Add The following jar either through classpath containers or the WEB-INF/lib folder.  This jar can be found at the spring-flex download:
    • org.springframework.flex-1.0.3.RELEASE.jar

Flex UI - ClassicFlexCars.mxml

  1. To get a simple list view of the miniature cars, all that is needed is a remoting object defined, a data grid, and a button to load the data:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
            <s:RemoteObject id="ro" destination="ProductService" />
        <s:VGroup horizontalAlign="left">
            <mx:AdvancedDataGrid dataProvider="{ro.loadProducts.lastResult}"/>
            <s:Button label="Get Cars" click="ro.loadProducts()"/>

Run it on BlazeDS

Add the BlazeDS tomcat server to the MyEclipse Server view by right-clicking the Servers pane and clicking Configure Server Connector.  Configure the Tomcat 6.x server to point to the BlazeDS tomcat directory.  Then add the ClassicFlexCars project to the server and run!  Browse to http://localhost:8400/ClassicFlexCars/ClassicFlexCars.html


< Page 1 | 2

Related Posts

Webclipse Twitter Chat – Recap October 24th Hello! here is the Genuitec Twitter chat recap! in case you missed it 😉Great! Its been a while since we last chatted about @Webclipse. Why don't we start off with some catching up! #genuitecchatQ1 What’s new in @Webclipse and @MyEclipseIDE land?A1 The highlight of recent releases has been #TypeScript support for #Eclipse, as promised in 2016 CI 6, ...
Creating My First Web App with Angular 2 in Eclips... Angular 2 is a framework for building desktop and mobile web applications. After hearing rave reviews about Angular 2, I decided to check it out and take my first steps into modern web development. In this article, I'll show you how to create a simple master-details application using Angular 2, TypeScript, Angular CLI and Eclipse Java EE.Tools and ...
Genuitec to Discontinue Development of GapDebug As GapDebug Product Manager, I want to share some information about the future of GapDebug. For almost 3 years we have developed and maintained GapDebug (@GapDebug) as a free debugging and app management platform for hybrid-mobile developers. It has been a fun learning experience with many cool challenges and rewards. After much consideration we ha...
How Developers Can Get in on the Pokémon Go Craze Unless you’ve been living under a rock, you’ve heard of Pokémon Go. This mobile app uses GPS to combine the virtual world and the real world. Back in the day, I logged many hours playing Pokémon on an old Nintendo Game Boy. Now, Pokémon Go has gotten me outside hunting for Pokémon because I want to "catch’em all"!I must not be the only nostalgic Po...

Posted on Feb 16th 2010