How to manage two java dispatchers in one project?
I have two Spring MVC projects. I want to merge project b into project a.
Create dispatcher servlet config:
<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 manager servlet b 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 url matching. I want to display /
in Project a and map /web
in Project b.
I want to combine these two mappings into a Project Manager servlet configuration.
How can I do it? No body can help me?
+3
source to share
No one has answered this question yet
Check out similar questions: