【问题标题】:Spring 3, Flex 4 Integration with SpringFlex 1.5.0.M2 api + configurationSpring 3、Flex 4 与 SpringFlex 1.5.0.M2 api + 配置集成
【发布时间】:2011-08-22 21:47:12
【问题描述】:

我们正在开展一个项目,我们使用 Spring 3 创建 Web 平台并使用 Flex 4 创建特定的客户端应用程序。目前,我们需要将 Spring 项目与 Flex 集成。

我们使用的是Spring-Flex集成库版本:1.5.0.M2

我检查了较早的问题,但这些条目中定义的集成配置通常适用于 BlazeDS 和 Spring 的早期版本。据我了解,可能存在一些差异。

谁能告诉我如何在 web.xml 和任何其他所需的 xml 文件中进行配置,以及文件夹结构如何。任何最新的教程链接将不胜感激。

我们的业务需求是:

应该存在两个 servlet:1) 具有映射 /.html 的 projectServlet 2) 具有映射 /messageBroker/

的 flexServlet

我们可以在 Flex 端使用的服务类如下:

package com.ecognitio.service;

import org.springframework.flex.remoting.RemotingDestination;
import org.springframework.flex.remoting.RemotingInclude;
import org.springframework.stereotype.Service;


@Service
@RemotingDestination
public class Foo {

    @RemotingInclude
    public void sayHello(String name){
        System.out.println("Hello: "+name);
    }

}

问候,

乌古尔

【问题讨论】:

    标签: flex4 blazeds spring-3


    【解决方案1】:

    我的Flex 4, Hibernate 3, and Spring 3 Integration Refcard 完成了所有设置的过程,应该可以在 1.5.0.M2 上正常工作(假设您已经更改了 Spring 配置文件中的命名空间)。但这是一个基本的 web.xml 示例:

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns
    /j2ee/web-app_2_4.xsd"
      version="2.4">
    
      <display-name>Project Template</display-name>
    
      <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</liste
    ner-class>
      </listener>
    
      <listener>
        <listener-class>flex.messaging.HttpFlexSession</listener-class>
      </listener>
    
      <servlet>
        <servlet-name>flex</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
          <param-name>contextConfigLocation</param-name>
          <param-value></param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
      </servlet>
    
      <servlet-mapping>
        <servlet-name>flex</servlet-name>
        <url-pattern>/messagebroker/*</url-pattern>
      </servlet-mapping>
    
    </web-app>
    

    这应该足以让你开始。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-17
      • 1970-01-01
      相关资源
      最近更新 更多