Spring Masters and members,
Can you help me with this problem.
I am having this error when creating a custom validation.
org.springframework.context.NoSuchMessageException : No message found under code 'notmatch.password' for locale 'en_US'.
org.springframework.context.support.AbstractMessag eSource.getMessage(AbstractMessageSource.java:160)
org.springframework.context.support.DelegatingMess ageSource.getMessage(DelegatingMessageSource.java: 71)
org.springframework.context.support.AbstractApplic ationContext.getMessage(AbstractApplicationContext .java:1166)
org.springframework.web.servlet.support.RequestCon text.getMessage(RequestContext.java:559)
org.springframework.web.servlet.support.BindStatus .initErrorMessages(BindStatus.java:177)
org.springframework.web.servlet.support.BindStatus .getErrorMessages(BindStatus.java:273)
org.springframework.web.servlet.tags.form.ErrorsTa g.exposeAttributes(ErrorsTag.java:173)
org.springframework.web.servlet.tags.form.Abstract HtmlElementBodyTag.writeTagContent(AbstractHtmlEle mentBodyTag.java:48)
applicationContext.xml is defined as follows:
<bean id="messageSource"
class="org.springframework.context.support.Resourc eBundleMessageSource">
<property name="basename" value="message" />
</bean>
message.properties is as follows:
required.password = Password is required!
required.confirmPassword = Confirm password is required!
notmatch.password = Password and Conform password is not match!
All error are working except for
notmatch.password = Password and Conform password is not match!
My validation are as follows:
if(password.equals(confirmPassword)==false) {
errors.rejectValue("users.password", "notmatch.password");
}
Looking forward for your help


Reply With Quote
