Spring MVC validation with Annotations

31,660

Solution 1

Have a look at §13.11.x of the Spring MVC documentation. It covers annotation-based controller configuration, including data binding. It should be very useful to you.

Good luck!

Solution 2

At a pinch, there's always this thing: http://annovalidator.sourceforge.net/ - it's all tooled around using annotations for validation, and is designed to work with Spring.

Share:
31,660
cdecker
Author by

cdecker

I'm a PhD student in Computer Science at ETH Zurich doing research on Bitcoin. Publications Bitcoin meets Strong Consistency Information Propagation in the Bitcoin Network (bibtex) Bitcoin Transaction Malleability and MtGox (bibtex) Have a Snack, Pay with Bitcoins (bibtex) BlueWallet: The secure Bitcoin Wallet (bibtex)

Updated on June 22, 2020

Comments

  • cdecker
    cdecker almost 4 years

    I'm having quite some trouble since I migrated my controllers from classical inheritance to use the annotations like @Controller and @RequestMapping. The problem is that I don't know how to plug in validation like in the old case. Are there any good tutorials about this?

  • cdecker
    cdecker about 14 years
    Sounds interesting, I'll definitely have a look at it :-)