Flex - SpringFramework Integration
There is alot of talk about the difficulties in integrating Flex with Java and the SpringFramework. Primarily tis is cause by the lack of a clear example in the documentation and installation software. This post tries to rectify this by giving a example as to integrate the two technologies. What will be done:
(Feel free to skip any steps if you already have the specific software installed on your system)
1. Installation of Tomcat
2. Installation of the Flex data service express war files into Tomcat
3. Install maven 2
4. Install Eclipse 3.3
5. Creation of a simple example in Eclipse
First. The installation of Tomcat. Goto the apache tomcat site and download the latest version. (Tomcat 6.x). Follow the install instructions and within 5 minutes you should have tomcat running on your machine.
Second. Get the Flex data service express from the adobe site. Remeber that this software is licenced. (Flex data Service express). From this we only need the following war-files: (flex.war, flex-admin.war en samples.war). Now that you have the war-files, deploy them in your tomcat installation (i.e. copy them in your <installroot>/webapps directory. Tomcat should autodeploy the war files. Now TEST is flex is running by going to the following adress (http://localhost:8080/flex). here you should see a message that FDS is running on your tomcat installation. If this is not the case, check your tomcat logs files as to the cause of your problem.
Third. Install maven 2 on your system. (Maven 2 download). Follow the install instructions provided by the maven team.
Fourth. Install Eclipse. I have installed Eclipse + the WTP preconfigured. (Eclipse all in)
Now that we have the prerequisits for our sample application, the "hard" word will begin. We are going to create a FDS flex spring application from the ground up.
1. First we fire up our Eclipse workbench. Next thing we will do is to create a standard maven 2 java project in Eclipse. This would look like this:
- <flexspringintegration>
- src/main/java
- src/resources
- src/test/java
- src/main/webapp
- pom.xml
- project.properties
- src/main/webapp/WEB-INF
- flex/
- hotfixes/
- jars/
- libs/
- locale/
- user_classes/
- lib/
- web.xml (the web.xml from the flex.war)
- flex/
- /src/main/java/nl/wowww/flex/spring/factory/SpringFactory.java
- /src/main/webapp/WEB-INF/applicationContext.xml