Assertions
Often, there's a need to check inter-field dependencies. For example, one may want to make sure, that the two given passwords are the same, two dates are within one week, or that some field is required if another field is non-empty.
To address this, Calyxo's form validation process may be configured to perform assertions. An assert expression is an arbitrary complex JSP EL expression, which may reference request parameters, form inputs and form data properties.
- Request parameters are referenced by the implicit object param, as in param.foo.
- Form inputs are referenced by the implicit object input, as in input.foo.
- Validated form data properties are referenced by the implicit object property, as in property.bar.
Note
Usually, you may assume form input foo to be the same
as request parameter foo. However, there may be request
parameters that are not specified as form inputs.
When an assertion fails, Calyxo marks the involved inputs to enable visual feedback to the user. For example, input fields involved in a failed assertion may be colored orange.


