How to register Spring @Configuration annotated class instead of applicationContext.xml file in web.xml?
In web.xml you need to bootstrap the context with AnnotationConfigWebApplicationContext: <servlet> <servlet-name>appServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextClass</param-name> <param-value> org.springframework.web.context.support.AnnotationConfigWebApplicationContext </param-value> </init-param> <init-param> <param-name>contextConfigLocation</param-name> <param-value> org.package.YouConfigurationAnnotatedClass </param-value> </init-param> </servlet> And don’t forget to use @EnableWebMvc for your MVC annotations to kick in. further reading: Spring 3.1 MVC Enhancements Spring 3.1 MVC Namespace Enhancements And Configuration EDIT as a … Read more