[英]Mule 3 and Spring MVC 3 integration
I am creating a webapp with Mule 3 and Spring mvc 3, the problem is I am not able to get mule beans in spring controllers. 我正在使用Mule 3和Spring mvc 3创建一个webapp,问题是我无法在Spring控制器中获得Mule bean。 My application context load with mule context and is not available in spring context, when I load application context in spring context then mule and spring both have different reference to a single bean. 我的应用程序上下文使用mule上下文加载,而在spring上下文中不可用,当我在spring上下文中加载应用程序上下文时,mule和spring都具有对单个bean的不同引用。 How can I get mule context in spring mvc controller so that I can refer to the same bean object. 如何在Spring MVC Controller中获取Mule上下文,以便可以引用相同的bean对象。 For ref my web.xml is defined below: 作为参考,我的web.xml定义如下:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="return-label-service" version="2.5">
<display-name>return</display-name>
<context-param>
<param-name>org.mule.config</param-name>
<param-value>mule-return-label-flow.xml,applicationContext.xml </param-value>
</context-param>
<context-param>
<param-name>mule.serverId</param-name>
<param-value>return-label-service</param-value>
</context-param>
<listener>
<listener-class>
org.mule.config.builders.MuleXmlBuilderContextListener
</listener-class>
</listener>
<!-- <context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath://applicationContext-web.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener> -->
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext-web.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
</web-app>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.