基于 structs2 validation的date格式验证

<?xml version="1.0" encoding="GBK"?>
<!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="kaishi">
   <field-validator type="date">
    <param name="min">2010-05-01</param>
    <param name="max">2040-01-01</param>
    <message>您输入起始时间有误!范围:20${min}到20${max}</message>
   </field-validator>
   <field-validator type="fieldexpression">
    <param name="expression"><![CDATA[(kaishi<jieshu)]]></param>
    <message>您输入起始时间大于结束时间!</message>
   </field-validator>
</field>
<field name="jieshu">
   <field-validator type="date">
    <param name="min">2010-05-01</param>
    <param name="max">2040-01-01</param>
    <message>您输入结束时间有误!范围:20${min}到20${max}</message>
   </field-validator>
</field>
 
 

你可能感兴趣的:(xml)