Results 1 to 8 of 8

Thread: Spring 3 MVC without annotation

  1. #1
    Join Date
    May 2011
    Posts
    14

    Default Spring 3 MVC without annotation

    Can we develop Controller without using annotation in spring 3. I want to use forms, how do I create without using annotations.

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    Yes you can, although that support is deprecated and will be removed in one of the future versions of spring (as with all the deprecated things). How to do that is explained in the reference guide, I suggest you give it a read.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    May 2011
    Posts
    14

    Default

    Thanks for the quick reply Marten.

    Yes. I agree with you the simpleformcontroller is deprecated. So, in Spring 3 if I need to use forms I have to use annotations, as in future releases we may not have the simpleformcontroller or any other controllers that were supported in Srping 2.5 version(it is present in portlet).

  4. #4
    Join Date
    Dec 2010
    Posts
    175

    Default

    Why would you use Spring 3.x if you don't want to use annotations? Do you have a strong case for it or just like that?

  5. #5
    Join Date
    May 2011
    Posts
    14

    Default

    That is a good question. I am developing new application, want to use all latest versions. So, that I can learn as well develop the same. when using the Spring 3, learnt that we should use annotation for MVC, not sure why only annotations are supported as part of MVC (any strong reasons for this drastic change in framework). Is Spring newer releases going annotation way?

  6. #6
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    The old style controllers are still supported but deprecated. The switch was made because with annotations you have more flexibility in writing your controllers then with the old style controllers. It is all about flexibility especially with the upcoming 3.1/3.2 releases this will show (although3.0 was a great step forward compared to 2.5).
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  7. #7
    Join Date
    Nov 2012
    Posts
    1

    Default

    Just wondering if the annotation approach is kind of anti-IOC?

  8. #8
    Join Date
    Jul 2009
    Location
    PUNE
    Posts
    43

    Default RE:Spring 3 MVC without annotation

    Quote Originally Posted by c.madhu.2005 View Post
    Can we develop Controller without using annotation in spring 3. I want to use forms, how do I create without using annotations.
    Hello,

    You may want to try MultiActionControllers. They are not deprecated and provide a good alternative.

    Regards,
    Prasad Khandekar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •