I have the following in a .ds.xml and when the validator for the password filed passes (if 2 password fields do match), it returns the "<fmt:message key="account.err.confirmPassword"/>" and displayed as an error message.
if the password fields do not match then, properly rendered string is returned.
Strange...or is it my configuration?
I have tried other validator types and works O.K.
<Debug>
=== 2010-02-10 18:07:17,099 [l0-1] INFO IDACall - Performing 1 operation(s)
=== 2010-02-10 18:07:17,114 [l0-1] DEBUG ValidationContext - Adding validation errors at path '/accountSpringDMI/confirmPassword': {errorMessage=<fmt:message xmlns:fmt="urn:jsptld:/WEB-INF/lib/fmt.tld" key="account.err.confirmPassword"/>}
=== 2010-02-10 18:07:17,114 [l0-1] INFO Validation - Validation error: [
{
recordPath:"/accountSpringDMI",
confirmPassword:{errorMessage:"<fmt:message xmlns:fmt=\"urn:jsptld:/WEB-INF/lib/fmt.tld\" key=\"account.err.confirmPassword\"/>"}
}
]
if the password fields do not match then, properly rendered string is returned.
Strange...or is it my configuration?
I have tried other validator types and works O.K.
<Debug>
=== 2010-02-10 18:07:17,099 [l0-1] INFO IDACall - Performing 1 operation(s)
=== 2010-02-10 18:07:17,114 [l0-1] DEBUG ValidationContext - Adding validation errors at path '/accountSpringDMI/confirmPassword': {errorMessage=<fmt:message xmlns:fmt="urn:jsptld:/WEB-INF/lib/fmt.tld" key="account.err.confirmPassword"/>}
=== 2010-02-10 18:07:17,114 [l0-1] INFO Validation - Validation error: [
{
recordPath:"/accountSpringDMI",
confirmPassword:{errorMessage:"<fmt:message xmlns:fmt=\"urn:jsptld:/WEB-INF/lib/fmt.tld\" key=\"account.err.confirmPassword\"/>"}
}
]
Code:
<!-- <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> --> <DataSource xmlns:fmt="urn:jsptld:/WEB-INF/lib/fmt.tld" ID="accountSpringDMI" serverType="generic"> <fields> <field name="id" type="text" primaryKey="true"> <title><fmt:message key="account.id"/></title> </field> <filed name="firstName" type="text" required="true"> <title><fmt:message key="account.firstName"/></title> </filed> <field name="lastName" type="text" required="true"> <title><fmt:message key="account.lastName"/></title> </field> <field name="pass" required="true"> <title><fmt:message key="account.password"/></title> </field> <field name="confirmPassword" required="true"> <title><fmt:message key="account.confirmPassword"/></title> <validators> <Validator type="matchesField" otherField="pass"> <errorMessage><fmt:message key="account.err.confirmPassword"/></errorMessage> </Validator> </validators> </field> <field name="authority" type="text" required="true"> <title><fmt:message key="account.authority"/></title> <valueMap> <value ID="ROLE_OPERATOR"><fmt:message key="account.authority.operator"/></value> <value ID="ROLE_SUPERVISOR"><fmt:message key="account.authority.supervisor"/></value> <value ID="ROLE_ADMINISTRATOR"><fmt:message key="account.authority.administrator"/></value> </valueMap> </field> </fields> <serverObject lookupStyle="spring" bean="accountSpringDMI"/> </DataSource>
Comment