We have an application that uses Spring BlazeDS integration. So far, we have just used Spring and Flex, and it is working fine. Now we have a requirement to add several Spring MVC controllers. Spring BlazeDS documentation says that the way to do this is to declare two sperate contexts in web.xml , as shown below:
<servlet> <servlet-name>flex</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>flex</servlet-name> <url-pattern>/messagebroker/*</url-pattern> </servlet-mapping> <servlet> <servlet-name>spring-mvc</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>spring-mvc</servlet-name> <url-pattern>/spring/*</url-pattern> </servlet-mapping>
Here is my question: there are Spring beans that should be used in both contexts: spring -mvc and flex are one. How can this be done - how can one declare a bean (either in xml or by scanning components) in one context and allow its sharing with beans declared in another context? Thank you
source share