我有一个页面,我输入开始日期和结束日期。我需要验证结束日期不应小于我尝试使用Xwork Validator实现相同的开始日期,但不是工作。以下是代码
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="endDateString">
<field-validator type="requiredstring">
<param name="trim">true</param>
<message>Please enter ABC end date</message>
</field-validator>
</field>
<field name="endDateString">
<field-validator type="regex">
<param name="expression">
^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.]
(19|20)\d\d$</param>
<message>Please enter a valid end date (dd/mm/yyyy)</message>
</field-validator>
</field>
<field name="endDateString">
<field-validator type="fieldexpression">
<param name="expression">
<![CDATA[#endDateString > #startDateString]]>
</param>
<message>ABC end date is before start date </message>
</field-validator>
</field>
</validators>
前两个验证工作但不是“fieldexpression” 请帮我解决这个问题
使用Struts:2.0.11