Summary
Spring offers an excellent validation framework. The Validator and Errors interface form the backbone and allow you to write your own Validator implementations. If you’d rather use declarative validation, have a look at Valang. This framework creates a Spring Validator instance based on a set of constraints defined in its proper validation language. Valang is very convenient to quickly write constraints for your command classes. Its operators, functions, and date parser functionalities offer more power and flexibility than Validators written in Java. Whether you write your Validators in Java or Valang, you should always test them to check whether all error conditions are rejected properly.
Next to validation Spring also offers support for internationalization through its MessageSource interface. This interface will resolve messages for the locale of your users so that you can offer your applications in their languages.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Rights and permissions
Copyright information
© 2006 Seth Ladd, Darren Davison, Steven Devijver, and Colin Yates
About this chapter
Cite this chapter
(2006). Validation. In: Expert Spring MVC and Web Flow. Apress. https://doi.org/10.1007/978-1-4302-0133-5_9
Download citation
DOI: https://doi.org/10.1007/978-1-4302-0133-5_9
Publisher Name: Apress
Print ISBN: 978-1-59059-584-8
Online ISBN: 978-1-4302-0133-5
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)