Link Details

Link 199524 thumbnail
User 276616 avatar

By fenrir
via uberwolf.blogspot.com
Published: Jul 06 2009 / 09:56

Spring 2.5.x introduces annotated controller that makes web development with Spring MVC a lot easier. No more XML is required for each controller you define. Spring MVC's annotated controller reminds me of Ben Parker's famous quote: "With great power comes great responsibility". What's the great responsibility of using the annotated controller? The validation!! With the old base-controller-classes approach you can just inject validators to your form controller and Spring MVC will take care of the validation for you. With annotated controller, this validation mechanism is removed. The common way to do validation with annotated controller is to inject Validator objects into your annotated controller and use its validate() method on the bean you want to validate. It's painful to write these validation steps manually in every request method. Luckily, with Spring 2.x's @Aspect, we can write a nice validation mechanism for our annotated controllers.
  • 12
  • 0
  • 974
  • 201

Comments

Add your comment
User 388907 avatar

MCII replied ago:

0 votes Vote down Vote up Reply

Someone still propagating AspectJ & Spring?

User 355617 avatar

piccoloprincipe replied ago:

0 votes Vote down Vote up Reply

How do you post this link? Dzone says to me:
"Your link could not be posted. Links to this domain have been prohibited.
URL: http://giorgiosironi.blogspot.com/
Reason: Blogspot spam"

User 276616 avatar

fenrir replied ago:

0 votes Vote down Vote up Reply

Hi piccoloprince, I used the (+) Add new link button on top of this screen and just entered everything required ^^
IMHO, you probably missed some required fields.

User 355617 avatar

piccoloprincipe replied ago:

0 votes Vote down Vote up Reply

I was posting the link to the root of the site and it appears to be blocked; posting a permalink to an article works. Thanks anyway. :)

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.