How do I manage two java dispatcher in one project?

218 views Asked by At

I have two Spring MVC projects. I want to merge Project b into Project a.

Project a's dispatcher servlet configuation:

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
        http://www.springframework.org/schema/beans     
        http://www.springframework.org/schema/mvc 
        http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
        http://www.springframework.org/schema/context 
        http://www.springframework.org/schema/context/spring-context-3.2.xsd">

    <context:component-scan base-package="com.mkyong.web" />

    <bean
      class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix">
            <value>/WEB-INF/views/jsp/</value>
        </property>
        <property name="suffix">
            <value>.jsp</value>
        </property>
    </bean>
    <mvc:resources mapping="/resources/**" location="/resources/" />

    <mvc:annotation-driven />
</beans>

Project b's dispatcher servlet configuration:

...
<bean id="webDispatcherMapping"
          class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"
          lazy-init="true">
        <property name="alwaysUseFullPath" value="true" />
        <property name="mappings">
            <props>
                <prop key="/web">#{webDispatcherMappingSystem}</prop>
                <prop key="/web/**">#{webDispatcherMappingSystem}</prop>
                <prop key="/web/resources/**">#{webDispatcherMappingSystem}</prop>
            </props>
        </property>
    </bean>
...

Now I want to merge Project B into Project a. My problem is the URL mapping. I want to map / to Project a , and map /web to Project b.
I want to merge these two mappings into Project a`s dispatcher servlet configuration.

How do I do? No body can help me?

0

There are 0 answers