Announcement Announcement Module
Collapse
No announcement yet.
Unable to get Message Resolver to work properly Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unable to get Message Resolver to work properly

    I have two files message.properties & message_en_GB.properties in my WEB_INF directory they both contain the following
    Code:
    validation.1=Please check the data you have entered is correct
    validation.2=This value cannot be left blank
    My Spring config file is in the same dir and references the files with
    Code:
    <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
          <property name="basename"><value>message</value></property>
       </bean>
    In one of my validators I have the code
    Code:
    errors.rejectValue&#40;"description","validation.2","Use Default"&#41;;
    and
    Code:
    errors.rejectValue&#40;"description","validation.2"&#41;;
    If the first one is triggered it works ok displaying the default message. But if the second one is triggered it fails with
    Code:
    Error 500&#58; No message found under code 'validation.2' for locale 'en_GB'.
    I cant understand what Im doing wrong.

    (The Application is running as an EAR on Websphere 6)

  • #2
    Did you try putting *.properties files into your classes dir?

    Comment


    • #3
      Originally posted by dejanp
      Did you try putting *.properties files into your classes dir?
      Thankyou very much, that works !

      (Im sure the dodumentation told me to put stuff straight into WEb-INF though)

      Comment

      Working...
      X