i have a User class with two fields, password and confirmPassword. on
a web form, upon post, i am trying to see if they match using the
fieldexpression validator. however, no matter what i try, i keep
getting the message that they don't match. in the Tomcat console, i
can see this message: Got result of null when trying to get Boolean.

my <ActionClass>-<alias>-validation.xml has the following defined. no
matter what i try for the OGNL expression, i still don't get the
correct results. for example, i've tried, #user.password ==
#user.confirmPassword, #user.password neq #user.confirmPassword, and
#user.password != #user.confirmPassword. any help is appreciated.

...
        <field name="user.password">
                <field-validator type="requiredstring">
                        <message>Password is required!</message>
                </field-validator>
                <field-validator type="fieldexpression">
                        <param name="expression"><![CDATA[#user.password eq
#user.confirmPassword]]></param>
                        <message>Passwords are not the same.</message>
                </field-validator>
        </field>
        <field name="user.confirmPassword">
                <field-validator type="requiredstring">
                        <message>Password confirmation is required!</message>
                </field-validator>
        </field>
...

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to