2011-05-11 23 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> 

這應該足以讓你開始。