繁体   English   中英

Mule 3和Spring MVC 3集成

[英]Mule 3 and Spring MVC 3 integration

我正在使用Mule 3和Spring mvc 3创建一个webapp,问题是我无法在Spring控制器中获得Mule bean。 我的应用程序上下文使用mule上下文加载,而在spring上下文中不可用,当我在spring上下文中加载应用程序上下文时,mule和spring都具有对单个bean的不同引用。 如何在Spring MVC Controller中获取Mule上下文,以便可以引用相同的bean对象。 作为参考,我的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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM