Is it possible to use the java.util.Calendar in a Struts2 IntRangeFieldValidator?
The following code does not produce any OGNL errors but does not work either. I'm trying to create a validation rule for a year range, min= 1970 and max= current calendar year.
@RequiredFieldValidator(message="Year cannot be blank")
@IntRangeFieldValidator(message="Year must be greater than 1970", min="1970", max="java.util.Calendar.getInstance().get(java.util.Calendar.YEAR)", fieldName="year")
public Integer getYear() {
return year;
}
Is there a better way to do this without writing a custom validator? Any/All replies are appreciated. Thanks in advance!