flex如何与SSH通信
http://zhidao.baidu.com/question/278595325.html Step1: 准备开发环境 (1) 下载Blazedshttp://opensource.adobe.com/wiki/display/blazeds/Release+Builds选择下载Turnkey版本,因为自带了一些不错的例子,对学习Blazeds很有帮助。打开下载好的压缩包,找到blazeds.war包,这就是我们真正需要的文件。 (2) 下载Blazeds调用Spring组件http://www.adobe.com/devnet/livecycle/articles/blazeds_spring.html下载Sample files,打开下载好的压缩包,factorysrcflexsamplesfactories路径的SpringFactory.java就是我们需要的组件。 Step2: 配置project (1) 配置Spring和Hibernate (2) 配置web.xml解压blazeds.war,打开WEB-INF目录下的web.xml,将下面这段代码拷贝到后台工程的WEB-INF/web.xml中<!-- Http Flex Session attribute and binding listener support --><listener> <listener-class> flex.messaging.HttpFlexSession </listener-class></listener><!-- MessageBroker Servlet --><servlet> <servlet-name>MessageBrokerServlet</servlet-name> <display-name>MessageBrokerServlet</display-name> <servlet-class> flex.messaging.MessageBrokerServlet </servlet-class> <init-param> <param-name> services.configuration.file </param-name> <param-value> /WEB-INF/flex/services-config.xml </param-value> </init-param> <load-on-startup>1</load-on-startup></servlet><servlet-mapping> <servlet-name>MessageBrokerServlet</servlet-name> <url-pattern>/messagebroker/*</url-pattern></servlet-mapping> (3) 配置Blazeds解压blazeds.war,将lib目录中的jar包拷贝到后台工程目录下的lib目录下,将flex目录拷贝到后台工程WEB-INF目录下 (4) 配置SpringFactory将在Step1第二步骤中找到的SpringFactory.java拷贝到相应的package下,然后打开WEB-INF/flex/services-config.xml,添加下面的配置:<factories> <factory id="spring" class="xxx.xxx.SpringFactory"/> </factories> (5) 配置remoting-config.xml打开WEB-INF/flex/services-config.xml,添加下面的配置:<destination id="productService"> <properties> <factory>spring</factory> <!-- source对应的是bean的id --> <source>xxxxx</source> </properties></destination> Step3: Flex端调用 (1) 添加RemoteObject <mx:RemoteObject id="rbt" destination="productService" endpoint="/xxxxxx/messagebroker/amf"> <!-- xxxxxx一般为后台工程名 --> ????????? <mx:method name="createProduct" result="resultCreateProduct(event)" fault="faultCreateProduct(event)"/> </mx:RemoteObject> (2) 调用RemoteObject rbt.createProduct(product); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- [Sqlite]-->数据迁移备份--从低版本3.6.2到高版本
- React-Native调试状态下App运行缓慢问题解决方案
- winform中,使用openfileDialog而引起的“Unable
- ios – 如何在Swift 4中使用Swift 3的已废弃语法
- postgresql – 如何将json数组转换为postgres数组
- Flex(AIR)操作文件 获取路径---damozhiying110
- 正则表达式和re模块知识点汇总
- c# – 从.net中的数据库返回数据:返回DataTable
- Binary XML file line #74: Error inflating cla
- c# – 将某些页面功能或用户界面限制为Asp.Net中