xwork / test / com / opensymphony / xwork / validator / validator-parser-test.xml

<!DOCTYPE validators PUBLIC
        "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
    <field name="foo">
        <field-validator type="required">
            <message key="test.key">You must enter a value for foo.</message>
    <field name="bar">
        <field-validator type="required" short-circuit="true">
            <message key="bar.key">You must enter a value for bar.</message>
        <field-validator type="int">
            <param name="min">6</param>
            <param name="max">10</param>
            <message>bar must be between ${min} and ${max}, current value is ${bar}.</message>
        <field-validator type="regex">
            <param name="expression">
                <!-- Some useless comment for the following expression, which should be ignored by parser -->
            <message>bar must must match the given expression.</message>
    <validator type="expression">
        <param name="expression">email.equals(email2)</param>
        <message>Email not the same as email2</message>
    <validator type="expression" short-circuit="true">
        <param name="expression">email.startsWith('mark')</param>
        <message>Email does not start with mark</message>