Overriding validation rules

You can override an existing validation rule by defining and registering a similar entry in their custom rules file.

When defining the rule you must give the same value for the following attributes:
  • id
  • inputName
  • inputType
  • url (if provided)
Note: The id attribute is the primary key to do the similarity check on a validation rule. If the id does not match, or is not defined, the validation rule will not be extended. And if the id matches but other attributes for similarity doesn't match, an exception will be thrown.
Note: You can only override rules that are registered using rule XMLs and NOT datatypes.xml file. Also, for abstract rules only the id attribute is checked.

You must register the new rule XML files with higher load orders.

Note: When you are registering validation rules for inputs, the following inputTypes constants must be used:
  • HTTPParameterValue
  • HTTPParameterName
  • HTTPCookieValue
  • HTTPCookieName
  • HTTPHeaderValue
  • HTTPHeaderName
  • HTTPScheme
  • HTTPServerName
  • HTTPContextPath
  • HTTPPath
  • HTTPQueryString
  • HTTPURI
  • HTTPURL
  • HTTPJSESSIONID
  • HTTPServletPath
  • JavascriptClient