Sorry for posting this one again, but its a bit urgent and maybe i have a chance
marking it as a post concerning [Validator].
Validating a Date with the Struts-Validator Framework works fine, but if the field i
want to validate is not a required field and may be empty, the validator always
reports an error, even if if i remove the depends="required" in the
validation-rules.xml.
Do i have to implement the Validator-class in a way that it doesnt validate empty
dates or is there any declarative way to solve this?
Thanks for any help.
Axel
This is my validation-rules.xml:
<validator name="date"
classname="org.apache.struts.util.StrutsValidator"
method="validateDate"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest"
msg="errors.date"
jsFunctionName="DateValidations">
and the validation.xml:
<field property="beginEmployment" depends="date">
<arg0 key="personal.data.beginEmployment" />
<var>
<var-name>datePattern</var-name>
<var-value>dd.MM.yyyy</var-value>
</var>
</field>