1 准备好东西
A 下载blazeds,这里下载blazeds_turnkey_3-0-0-544的版本,因为自带了tomcat还有些好的例子
B FLEXBUILDER 3
C MYSQL 5
D SPRING+HIBERNATE,myeclipse,这些就不说了.
2 本文是根据http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=2&postId=7923
去小结的.其中在http://www.adobe.com/devnet/livecycle/articles/blazeds_spring.html中,讨论了如何跟spring结合,如何跟
hsqldb结合.那么文中是举了blazeds自带的例子来做说明的,在它的基础上进行修改,变成hibernate+spring.
3 先从http://download.macromedia.com/pub/developer/flex_spring.zip下载例子文件,其中包括了例子和作者写的
用spring调用的组件.
解压flex-spring.zip
将/flex-spring/factory/bin/flex/samples/factories 目录下的class文件拷贝到/WEB-INF/classes/flex/samples/factories目录中
4 在/WEB-INF/flex/services-config.xml文件中注册spring factory
<factories>
<factory id="spring" class="flex.samples.factories.SpringFactory"/>
</factories>
5 配置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>