You are hereCommons Validations
Commons Validations
Commons Validations has long been a popular package for validation in the Spring and Struts world, and now it is available in th Aria framework.
Aria has its own lightweight validation and though it is extensible, there have been few user conributions to help flesh out the validator range. Commons on the other hand as a much broader set of validations available, so leveraging this framework was an obvious choice. The downside however, is that commons brings with it some dependancies and this makes it quite heavy for what it does.
The integration of commens therefore has been by way of a separate project/jar so that it can be included optionally. In addition the integration includes support for the latest POJO features and can be easily enabled by adding the following to the validation declarations
<Validation name="pojoFields"
class="org.formaria.pojo.commons.PojoCommonsFieldValidator"
node="pojo"/> in the validations.xml file.
To avoid naming collisions the commons validations files are prefixed "commons-" and by default commons-validations.xml and commons-validator-rules are loaded. The error messages are localized in the usual Aria way with the language files.
In a bid to optimize the inclusion of commons some of the dependant libraries have been partially included as only one or two methods were actually used so it was more efficient to include just these methods (or even JRE library replacements). This optimization could be taken much further, but for now that task is deferred.
Error Badges
A nice new feature of Aria is the ability to display error badges for those components that have failed input validation. This gives an additional level of user feedback and augments the tooltips and error styling. The above screenshot some errors in the input hightlighted by these error badges, and the good news is that no coding is requried - just add the entry
ShowErrorBadges=true
to the startup.properties file, and when the input error is resolved the error badge is cleared :-)