I am trying to debug an issue with RequestMappingHandlerAdapter
initialization and I have come to a conclusion by searching the Web that it is getting initialized from mvc:annotation-driven
xml entry. Can anyone explain me briefly, how this initialization works i.e. what happens when the parser parses mvc:annotation-driven
? Or point me to the code that does it and I will trace it through.
Some more context on this:
I was trying to get RequestMappingHandlerAdapter from the context via autowire but could not. It gave me:
No matching bean of type [org.springframework.web.servlet.mvc.method.annotation.RequestMappingH
andlerAdapter]
expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
Found this thread, but the solution does not does not work: Spring, Jackson and Customization (e.g. CustomDeserializer)
I am using: Spring 3.1.3
This is what my servlet xml file looks like ...
<context:annotation-config />
<context:component-scan base-package="com.xyz" />
<mvc:annotation-driven />
Thanks, Parth