Announcement Announcement Module
Collapse
No announcement yet.
Validation Error: org.springframework.context.NoSuchMessageException : No message foun Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Your properties file is "message.properties or "messages.properties"?. It maybe typing error

    Your file can be "messages_en_US.properties"

    Comment


    • #3
      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.

      Comment

      Working...
      X