2011-05-11 45 views
0

我们正在开发一个项目,我们正在使用Spring 3创建Web平台并使用Flex 4创建特定的客户端应用程序。目前,我们需要将Spring项目与Flex集成。Spring 3,Flex 4与SpringFlex 1.5.0.M2 api +配置集成

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

我签上了年纪的问题,但在这些条目中定义的集成配置一般是BlazeDS和Spring之前的版本。正如我所了解的,可能有一些不同之处。

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

我们的业务要求是:

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

我们的服务类,可用于的.html 2)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); 
    } 

} 

问候,

Ugur

回答

0

我的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> 

这应该足以让你开始。