集成 Spring-Flex

本文介绍了一种使用SpringBlazeDSIntegration(SBI)进行集成的方法。通过参考具体教程,搭建了Spring 2.5和BlazeDS环境,并在WEB工程中进行了配置。详细步骤包括下载相关软件、设置web.xml及applicationContext.xml等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

前两天听同事说 Spring BlazeDS Integration(SBI),之前一直用LCDS开发,今天试了试,感觉还是比较简洁(jar比较少)的。

 

主要参考这篇http://www.ibm.com/developerworks/cn/web/0912_zouxiang_flex_spring/?ca=drs-tp4608文章

下载demo_central.zip

 

spring下载2.5版本(http://www.springsource.com/download

blazeDS    http://opensource.adobe.com/wiki/display/blazeds/Downloads

 

新建一个WEB工程,从demo_central.zip拷贝相关的文件,修改下面两个配置文件

web.xml:

 

 <listener>

        <listener-class>flex.messaging.HttpFlexSession</listener-class>

 </listener>

 

<servlet>

      <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>

      <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>

      <init-param>

            <param-name>contextConfigLocation</param-name>

            <param-value>/WEB-INF/applicationContext.xml</param-value>

      </init-param>

     <load-on-startup>1</load-on-startup>

</servlet>

 

 

<servlet-mapping>

     <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>

      <url-pattern>/spring/*</url-pattern>

</servlet-mapping>

 //注释掉,不然报错 

 

  <listener>

        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>

  </listener>

 

 

 

applicationContext.xml:

<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">

     <property name="mappings">

        <value>

        /*=springManagedMessageBroker

       </value>

</property>

</bean>

<bean class="org.springframework.flex.servlet.MessageBrokerHandlerAdapter"/>

 

<bean id="springManagedMessageBroker" class="org.springframework.flex.core.MessageBrokerFactoryBean" />

 

 

验证成功:在浏览器中输入 http://localhost:8080/demo_central/spring/messagebroker/amf 并回车,浏览器就会显示一个空白的 Web 页面

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值