First, set up the project blazeds
1, will blazeds.war extract to a directory, such as: myflex /;
2, set up java works were such as: MyFlex, in the orientation of selection create project from existing source and in the path selection myflex / WEB-INF
3, in the next step, the Default output folder will point to the content of classes directory (MyFlex / classes) can be.
Second, the introduction of spring Supporting documents
1, extract the flex-spring.zip
2, / flex-spring/factory/bin/flex/samples/factories directory of class files are copied to the / WEB-INF/classes/flex/samples/factories directory
3, in the / WEB-INF/flex/services-config.xml document register spring factory
<factories>
<factory/>
</ factories>
Three, applications
1, configuration web.xml
<context-param>
<param-name> contextConfigLocation </ param-name>
<param-value> / WEB-INF/applicationContext.xml </ param-value>
</ context-param>
<listener>
<listener-class> org.springframework.web.context.ContextLoaderListener </ listener-class>
</ listener>
2, in / WEB-INF/applicationContext.xml document register spring bean;
<bean>
<property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
<property name="url" value=" jdbc:hsqldb:hsql://localhost:9002/flexdemodb"/>
<property name="username" value="sa"/>
<property name="password" value=""/>
</ bean>
<bean>
<property name="dataSource" ref="dataSource"/>
</ bean>
3, configuration flex remoting destination
(1) Open / WEB-INF/flex/remoting-config.xml document
(2) add a service destination, such as:
<destination>
<properties>
<factory> spring </ factory>
<source> productdao </ source>
</ properties>
</ destination>
4, flex call
<? xml version = "1.0" encoding = "utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:RemoteObject destination="tutorial-product"/>
<mx:DataGrid dataProvider="{ro.getProducts.lastResult}" width="523" height="184"/>
<mx:Button label="get data" click="ro.getProducts()" x="169" y="235"/>
</ mx: Application>







