title: Thymeleaf doesn't find message source
body: <p>I'm actually confused about a part of my Thymeleaf configuration.</p>
  
  <p>I have a property file located at <code>classpath:/messages/web.properties</code>. In my configuration the following is defined.</p>
  
  <pre><code>@Bean
  public MessageSource messageSource() {
      final ResourceBundleMessageSource messageSource;
  
      messageSource = new ResourceBundleMessageSource();
      messageSource.setDefaultEncoding("UTF-8");
      messageSource.setBasename("messages/web");
  
      return messageSource;
  }
  </code></pre>
  
  <p>If I run my application with this configuration everything works fine. The messages from the properties file are injected into the Thymeleaf template (as expected).</p>
  
  <p>But if I change the name of the method which creates my message source, restart my application and request the same page... then the messages from my <code>web.properties</code> file are not found.</p>
  
  <pre><code>@Bean
  public MessageSource webMessageSource() {
      [...]
  }
  </code></pre>
  
  <p>Why the bean name (= method name) of the message resource has this impact to my application?</p>
  
  <p>Why the message source <code>webMessageSource</code> could not be found by the Thymeleaf template engine?</p>