private ValueExpression maximum;
protected Validator createValidator() throws JspException {
final FacesContext facesContext = FacesContext.getCurrentInstance();
final Application application = facesContext.getApplication();
final SubmittedValueLengthValidator validator
= (SubmittedValueLengthValidator) application.createValidator(SubmittedValueLengthValidator.VALIDATOR_ID);
final ELContext elContext = FacesContext.getCurrentInstance().getELContext();
if (minimum != null) {
try {
validator.setMinimum((Integer) minimum.getValue(elContext));
} catch (final NumberFormatException e) {
// ignore
}
}
if (maximum != null) {
try {
validator.setMaximum((Integer) maximum.getValue(elContext));
} catch (final NumberFormatException e) {
// ignore
}
}
return validator;