title: Spring: how to set @DateTimeFormat pattern from a properties file?
body: <p>I'm posing the same question asked <a href="https://stackoverflow.com/q/17979137/225217">here</a> because the answers provided therein do not resolve my issue.</p>
  
  <p>I'm using Spring 4.1.3 in a Spring MVC web application. I have a JPA entity bean containing the field:</p>
  
  <pre><code>@DateTimeFormat(pattern = "${date.format}")
  private LocalDate certifiedOn;
  </code></pre>
  
  <p>I'd like the pattern to be injected based on a key in a properties file.  <a href="https://jira.spring.io/browse/SPR-7087" rel="nofollow noreferrer">This should work in Spring since 3.0.3</a>, however the binding fails in the controller because the <code>Pattern includes reserved character '{'</code>.</p>
  
  <p>I know that I am successfully reading my properties file as other properties are being used in the application.  Here is how I've got that setup via javaConfig:</p>
  
  <pre><code>@Configuration
  @ComponentScan(basePackages = "com")
  @PropertySource("classpath:spring.properties")
  public class AppConfig {
  
    @Bean
    public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
      return new PropertySourcesPlaceholderConfigurer();
    }
    ...
  }
  </code></pre>
  
  <p>At the root of the classpath sits the <code>spring.properties</code> file:</p>
  
  <pre><code>date.format = yyyy-MM-dd
  </code></pre>
  
  <p>What am I missing here that would prevent this from working? </p>