stanlick wrote:
I am trying to figure out the <validator type="expression"> and not having
much success.  Can someone tell me what is wrong with this?


        <field name="model.password">
                <field-validator type="requiredstring">
                        <message key="requiredstring" />
                </field-validator>
        </field>
        <field name="model.confirmPassword">
                <field-validator type="requiredstring">
                        <message key="requiredstring" />
                </field-validator>
        </field>
        <validator type="expression">
                
                        model.password.equals(model.confirmPassword)
                
                <message>${getText("nomatch")} ${min} and ${max}</message>
        </validator>

The documentation is ambiguous, since the description says the validator uses a regular expression but the parameter description says it uses an OGNL expression. Assuming the latter is correct, you might try changing your expression to 'model.password == model.confirmPassword', though I would have thought what you have would work.

What's actually happening with what you have? Do you get any errors logged? Are the other validations working correctly? I'm assuming it's just a typo that your expression is not wrapped in <param name="expression"> </param> tags, and that you have a message that doesn't seem to be relevant to the validation?

If you're still having problems, make sure to post the exact code that you're actually using and describe exactly what is happening (or not happening) as a result.

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to