Results 1 to 3 of 3

Thread: Validation Error: org.springframework.context.NoSuchMessageException : No message foun

  1. #1
    Join Date
    Aug 2011
    Posts
    21

    Default Validation Error: org.springframework.context.NoSuchMessageException : No message foun

    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

  2. #2
    Join Date
    Apr 2006
    Posts
    166

    Default

    Your properties file is "message.properties or "messages.properties"?. It maybe typing error

    Your file can be "messages_en_US.properties"

  3. #3
    Join Date
    Aug 2011
    Posts
    21

    Default

    Quote Originally Posted by shoa View Post
    Your properties file is "message.properties or "messages.properties"?. It maybe typing error

    Your file can be "messages_en_US.properties"
    ooopsss. message? is it suppose to be messages? i am just a new to spring. if that is so, i would say thank you very much, ill try it now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •