• flex 学习篇 Spring BlazeDS Integration的使用


     
     

    到目前为止,网上的大部分内容都是旧的,然后各位网友都在拼命的复制黏贴那些旧内容,导致新的东西几乎被覆盖掉,甚至误导了新手,把旧的配置当成新的来用。

     Top 2. 把请求映射到Spring管理的MessageBroker,请求映射必须在3个地方被配置:

    1. DispatcherServlet mapping in web.xml(在web.xml配置DispatcherServlet

    2. HandlerMapping in the Spring WebApplicationContext(配置SimpleUrlHandlerMapping标签)

    3. Channel definitions in the BlazeDS services-config.xml

      <!-- Map all /messagbroker requests to the DispatcherServlet for handling -->
      <servlet-mapping>
          <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
          <url-pattern>/messagebroker/*</url-pattern>
      </servlet-mapping>  

    使用这个标签<flex:message-broker />时,相当于默认调用

     1 <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    2 <property name="mappings">
    3 <value>
    4 /*=_messageBroker
    5 </value>
    6 </property>
    7 </bean>
    8
    9 <!-- Dispatches requests mapped to a MessageBroker -->
    10 <bean class="org.springframework.flex.servlet.MessageBrokerHandlerAdapter"/>

    注:When using the message-broker config tag, a SimpleUrlHandlerMapping is installed that by default maps all incoming DispatcherServlet requests to the Spring-managed MessageBroker using a /*path pattern.
    必须在BlazeDS 的services-config.xml文件中调整管道定义的映射。

    1 <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
    2 <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf"
    3 class="flex.messaging.endpoints.AMFEndpoint"/>
    4 <properties>
    5 <polling-enabled>false</polling-enabled>
    6 </properties>
    7 </channel-definition>



  • 相关阅读:
    poj2240
    poj1135
    poj1062
    poj3278
    2218 补丁vs错误
    必做: 1041、1024、1077、2218、1183(较难)
    poj2828
    poj3253
    洛谷P1122 最大子树和
    1074 食物链
  • 原文地址:https://www.cnblogs.com/pandaXiong/p/2369732.html
Copyright © 2020-2023  润新知