Quote Originally Posted by zzkhan View Post
I think viewnames for controllers (e.g. formView, successView and so on) come under configuration as well and for goods reasons, for instance if you need to reuse the logic in a given controller for presenting different views and the fact that you dont want to hardcode the flow of the application in your code.

Specifying viewnames in spring config was done by convention before the introduction of Annotated controllers in 3.0 because the good old Abstract Controller classes sort of 'advised' us to do so along with some other stuff. However after the advent of Annotated controllers, a lot of the 'guiding principles' (some viewed these as constraints) are gone with the abstract controllers getting deprecated in 3.0.

For people who despise XML configuration annotations is seen as the way to go to get to this utopia zero XML config controller configuration, and in getting to this the tendency is to hardcode things like viewnames in the controllers just to get away with not having it in configuration which I think is wrong as you are taking away the flexibility of your application just to save a handful of XML config.

Any thoughts?
I agree
I tend to use annotations only to avoid the dependency of the mvc class itself. I still prefer the xml configuration since I find many places where a single controller class is configured differently for serving different cases. Furthermore this framework-independance allows me to have some base functionality classes that can be extended by my controllers no matter if they are SimpleForm or ParametrizableView style or whatever. Untill 2.5 I had to use some type of delegation pattern for these cases but no more...
I still believe though that new Spring users should have a look at the javadocs of the -now deprecated- controllers (especially AbstractFormController) to have a basic idea of how things are handled under the covers