Legacy platform

Validation rules

In the application validation rules are defined in the wsc_validationrules.xml file.

The wsc_validationrules.xml file is in the <INSTALL_DIR>\repository\eardata\wsc\war\WEB-INF\validationrules directory.

For validating the open form widgets on the server side, the wsc-param-value-openform-abstract-rule abstract validation rule is added in the wsc_validationrules.xml file. This validation rule implements the com.sterlingcommerce.security.dv.SCByPassValidationRule Java™ class, which accepts the input value, checks for double encoding patterns, if any, and returns the input value.

By default, the open form widgets must accept all the input values. Hence, the input values that are returned from the Java class is not validated against any regular expression and is saved without any changes.

Note: If you mark any widget as an open form, a new rule must be created by extending the wsc-param-value-openform-abstract-rule abstract rule.

For example, the validation rule for notetext param value in the wsc_validationrules.xml file is defined as follows:

<ValidationRules>
<Rule id="wsc-notetext-param-value-regex-rule" inputType="HTTPParameterValue" 
		inputName="NoteText" extends="wsc-param-value-openform-abstract-rule"/>
</ValidationRules>