I am working on an application that was developed in Spring 2.5 using XML mappings. We recently upgraded our JARS to Spring 3.0, and also added some scanning components, trying to use Spring 3.0 with new MVC features, while preserving existing XML mappings.
However, if we added the following to enable mvc sping annotations
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<mvc:annotation-driven/>
</beans>
Then, Spring only searches for controllers annotated with @Controller, and our old ones It seems that XML mappings are ignored. The only solution to this problem is that we need to update all of our old XML mappings to be annotations (a difficult task) or is there some other solution?
XML- :
<bean id="loginController" class="com.app.controller.login.LoginController">
<property name="loginService" ref="loginService"/>
</bean>
LoginController SimpleFormController. SimpleFormController, MultiActionController.
.
<bean id="urlMapping"
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="/login">loginController</prop>
...