Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

MVC migration from 2.0 inheritance-based to 3.0 annotation

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to migrate my existing 2.0 inheritance based application to Spring 3.0 REST annotations, preferably one controller at a time keeping it functional the whole time. It would be handy if I could add to what I have so I could asynchronously modify the client side: in other words maintain the existing controller while adding the new RESTful ones, but that is nice-to-have: if I must modify the client side simultaneously then that's fair.

I see much documentation of how to write new controllers, but how do I repair what I have got?

If my app has an existing inheritance hierarchy of controllers - do I just remove the "extends Asynchronous..." from the baseclass? That would make me modify hundreds of controllers at once right there. Does it hurt to both leave the "extends" and add "@Controller"? What about applicationContext, leave the old mappings while adding that new search-one?

I could not find posts/articles addressing this, thanks,
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm curious what happened you tried it--seems a quick-enough test.
Posts: 17346
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For URL Mapping you can define multiple mappers in your configuration and set an index to say which one to use first. So you can go one by one on the Controllers and change them.

and previous version

The order attribute is what you use to say use one HandlerMapping class first before the other. A lower number is used before a higher number.

Hope that helps.

    Bookmark Topic Watch Topic
  • New Topic