Description
In UIInput.shouldInterpretEmptyStringSubmittedValuesAsNull() the resolved value of 'javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL' is cached in the application map. It might be worth doing the same for 'javax.faces.VALIDATE_EMPTY_FIELDS' in UIInput.shouldValidateEmptyFields():
private boolean shouldValidateEmptyFields(FacesContext context)
{
ExternalContext ec = context.getExternalContext();
Boolean validateEmptyFields = (Boolean) ec.getApplicationMap()
.get(VALIDATE_EMPTY_FIELDS_PARAM_NAME);
if (validateEmptyFields == null)
{
String param = ec.getInitParameter(VALIDATE_EMPTY_FIELDS_PARAM_NAME);
// null means the same as auto.
if (param == null)
else
{ // The environment variables are case insensitive. param = param.toLowerCase(); } if (param.equals("auto") && _ExternalSpecifications.isBeanValidationAvailable())
else if (param.equals("true"))
{ validateEmptyFields = true; }
else
{ validateEmptyFields = false; } // cache the parsed value
ec.getApplicationMap().put(VALIDATE_EMPTY_FIELDS_PARAM_NAME, validateEmptyFields);
}
return validateEmptyFields;
}