Skip to end of metadata
Go to start of metadata


Validation is implemented in 3 different areas of the application:

  1. Form Conversion (POJO)

    Attempts to convert incoming request parameters to the underlying type of the action form. If the parameter value cannot
    be converted to the type, an error is added, and control passed back to input jsp. ActionForm populate() method is the hook
    for this validation

  2. Validation against the data dictionary

    Validates form business objects against the restrictions defined in the data dictionary.

  3. Business Rules Container

    Executes business rules on document route (See the rules documentation for additional information on the application of business rules.)

Validation Framework Classes

  • org.kuali.util.ErrorMap (junit org.kuali.util.ErrorMapTest)
    Map that collects errors throughout a validation session. At each request, a new ErrorMap is added to
    GlobalVariables. Any method of the application can pull the ErrorMap out and add errors as needed:
    At the end of request processing, the ErrorMap is checked, and any errors are translated to ActionMessages for
    display in the jsp.
  • org.kuali.exceptions.ValidationException
    Any exceptions encountered by the validation framework are wrapped in a ValidationException.
  • org.kuali.service.(impl.)DictionaryValidationService(Impl) (junit org.kuali.service.DictionaryValidationServiceTest)
    Provides entry points to validation against the data dictionary.
  • errors.tag
    Provides display of errors in the ui. The keyMatch attribute is a comma delimited string of error keys to match on. The tag
    performs a like on each against error keys in the map.
    The above would display any errors whose key starts with document.sourceAccountingLines or newSourceLine (e.g.,
    document.sourceAccountingLines.account.accountNbr, newSourceLine.projectCode, ...)

Adding Error Messages

  • When an error is encountered (e.g., in a Rule, or Business Object validation) add error to ErrorMap
  • GlobalVariables provides access to the ErrorMap for the request
  • The first parameter to the ErrorMap is the fully qualified path to the field on the action form, less any prefix terms that have been added to the ErrorMap using the addToErrorPath method.
    For information on other methods available to manipulate the ErrorMap and ErrorPath refer to the ErrorMap javadoc.
  • The second parameter to the ErrorMap is the error constant for the error message.
  • The third parameter is any parameters for the message. If multiple parameters are needed, construct a string array (String[]) with the parameters.

The text for errors are maintained as system messages and can be changed or added by changing system messages.

Unable to render {include} The included page could not be found.
  • No labels