>From the validator documentation. <validator type="expression"> <param name="expression">email.equals(email2)</param> <message>Email not the same as email2</message> </validator>
Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications > From: mojoRising <[EMAIL PROTECTED]> > Reply-To: Struts Users Mailing List <user@struts.apache.org> > Date: Thu, 28 Feb 2008 13:31:19 -0800 (PST) > To: <user@struts.apache.org> > Subject: expression validator > > > (java - struts 2 - JSP - using xml based validation) > I am trying to figure out how to do a simple client side validation > expression, checking that two fields are equal. Could someone help me figure > this out, I am sure it is very simple but I can't find out what I am > missing. I keep getting this error: > > SEVERE: The content of element type "field" must match "(field-validator)+". > at (null:46:13) > org.xml.sax.SAXParseException: The content of element type "field" must > match "(field-validator)+". > > The two fields I am checking are password and password2. They are defined in > my validation xml as: > > <field name="password"> > <field-validator type="requiredstring"> > <message key="requiredstring"/> > </field-validator> > </field> > <field name="password2"> > <field-validator type="requiredstring"> > <message key="requiredstring"/> > </field-validator> > <validator type="expression"> > password.equals(password2) > <message>Passwords do not match</message> > </validator> > </field> > > I also tried these two variations: > > <validator type="expression"> > <![CDATA[password.equals(password2)]]> > <message>Passwords do not match</message> > </validator> > > And: > > <validator type="expression"> > password == password2 > <message>Passwords do not match</message> > </validator> > -- > View this message in context: > http://www.nabble.com/expression-validator-tp15746472p15746472.html > Sent from the Struts - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > This email and any attachments ("Message") may contain legally privileged and/or confidential information. If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email. Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]