Announcement Announcement Module
Collapse
No announcement yet.
XML and Annotation Driven Configurations Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • XML and Annotation Driven Configurations

    Our application is currently using XML configuration for MVC. We want to slowly migrate over to using annotation-driven beans. Is it possible to use both? If I add in <mvc:annotation-driven> to our XML configuration I get "No adapter for handler [...]: Does your handler implement a supported interface like Controller?

    Some beans are configured in XML configuration and do not have annotations, but newly created beans will be configured via annotations and request mapping. Is this possible?

    Thanks

  • #2
    Hello

    when you use <mvc:annotation-driven> some beans definitions are automatically created internally by Spring, read the documentation about this carefully

    Some beans are configured in XML configuration and do not have annotations, but newly created beans will be configured via annotations and request mapping. Is this possible?
    could be, I suggest create a new project and define two controllers, one defined with XML and the other with @Controller, once you got all working, I mean about configuration, proceed to apply in your project

    I get "No adapter for handler [...]: Does your handler implement a supported interface like Controller?
    Post the complete error stack trace, and post the source code from where this exception was thrown (I am assume is a 'controller')

    Let me know your advance

    P.d: without your actual configuration we dont have more details

    Comment


    • #3
      There should be no problem in using both together... However if you use mvc:annotation-driven spring enables annotations and disables the old stuff.. If you want to have your old controllers executed you need to add a SimpleControllerHandlerAdapter (that is basically the component which knows HOW to execute a Controller).

      Comment

      Working...
      X