Spring 3, Flex 4 Integration with SpringFlex 1.5.0.M2 api + configuration
We are working on a project where we are using Spring 3 to create a web platform and using Flex 4 to create a specific client side application. Currently, we need to integrate Spring project with Flex.
We are using Spring-Flex integration library version: 1.5.0.M2
I checked the older questions but the integration configurations defined at those entries are generally for previous versions of BlazeDS and Spring. And as I understad, there may be some differencies.
Can anybody tell me how to do the configuration in web.xml and any other xml files needed,and how the folder structures will be. Any up-to-date tutorial links will be appreciated.
Our business requirements are:
Two servlets should exist: 1) projectServlet that has mappings /.html 开发者_Go百科 2) flexServlet that has mappings /messageBroker/
Our service classes that can be used in Flex side will be like:
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);
}
}
Regards,
Ugur
My Flex 4, Hibernate 3, and Spring 3 Integration Refcard walks through the process of setting everything up and should work fine with 1.5.0.M2 (assuming you have changed the namespace in the Spring config file). But here is a basic web.xml example:
<?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>
That should be enough to get you started.
精彩评论