Announcement Announcement Module
Collapse
No announcement yet.
MessageSource Problem. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • MessageSource Problem.

    I specifed my resource files in applicationContext.xml as follows

    <bean id="messageSource" class="org.springframework.context.support.Resourc eBundleMessageSource">
    <property name="basename">
    <value>messages</value>
    </property>
    </bean>

    (i placed messages.properties under WEB-INF/classes)

    I am reading in my class as follows using injection

    private MessageSource messages;
    public void setMessages(MessageSource messages){
    this.messages=messages;
    }

    String firstName = messages.getMessage("firstName",null,"First Name",new Locale(en));

    It is always returning me the default message ,not the one exising in messages_en.properties file

    can any one please help me for this.

    Guru

  • #2
    hmmm

    I highly doubt if thats the right way. Are you just trying to display the message to the user on some input or ?

    Comment


    • #3
      Originally posted by christopher1234 View Post
      I highly doubt if thats the right way. Are you just trying to display the message to the user on some input or ?
      Just i want the messages from properties file for sending the mail in specific locale.(before sending the mail i need some static resourcebundle data for forming the mail body)

      Comment

      Working...
      X