struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mojoRising <jpi...@averoinc.com>
Subject expression validator
Date Thu, 28 Feb 2008 21:31:19 GMT

(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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message