CharSequence formID = jsEscape(mForm.getMarkupId());
CharSequence compID = jsEscape(mComponent.getMarkupId());
String message = Application.get().getResourceSettings().getLocalizer().getString(getResourceKey(), mComponent);
Map<String, Object> vars = variablesMap(mForm, mComponent);
boolean thrExc = Application.get().getResourceSettings().getThrowExceptionOnMissingResource();
MapVariableInterpolator mvi = new MapVariableInterpolator(message, vars, thrExc);
CharSequence escapedMessage = jsEscape(mvi.toString());
String validator = createValidatorConstructorJavaScript(formID, compID, escapedMessage);
String js = "ClientAndServerValidator.registerValidator(" + validator + ");";
response.renderOnDomReadyJavascript(js.toString());
}