Spring Framework

To use Spring objects with Flex BlazeDS the Spring factory can be registered in BlazeDS. Spring beans can be referenced as remote services objects in BlazeDS.

A better way is to manage the Spring beans in a Spring way. Therefor the BlazeDS messagebroker is configured as a Spring bean and Flex messenges are routed to Spring.


There are several ways to integrate Spring Security with the BlazeDS Security process. How this can be done is out of scope here but remains to be solved when building a solid J2EE application.

Person case - Configuration 1

Spring is used to manage the actual configuration of the Flex services for BlazeDS. Configuration in BlazeDS itself can be reduced to a minimum.

There are three steps to realize this. First all Flex calls must be routed via Spring. Secondly Spring must be connected to BlazeDS. Lastly Spring must manage all remote services for BlazeDS.

The routing of Flex calls via Spring is solved in the web.xml. A servlet is defined to do this. When Spring is also used for other purpose it is wise to seperate BlazeDS definitions from the 'normal' Spring application context.

The web.xml may look like this.

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="BlazeDS_Application" version="2.4" 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
	<description>BlazeDS Application</description>





	<!-- MessageBroker Servlet -->
		<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>

	<!-- Map all *.spring requests to the DispatcherServlet for handling -->
		<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>