title: How to replace a placeholder in a String with a SimpleDateFormat Pattern
body: <p>In a given String like this</p>
  
  <pre><code>".../uploads/${customer}/${dateTime('yyyyMMdd')}/report.pdf"
  </code></pre>
  
  <p>I need to replace a <code>customer</code> and a <code>yyyyMMdd</code> timestamp.</p>
  
  <p>To replace the <code>customer</code> placeholder, I could use the <code>StrSubstitutor</code> from Apache Commons. But how to replace the <code>SimpleDateFormat</code>? We are running in a Spring enviourment, so maybe <code>Spring EL</code> is an option?</p>
  
  <p>The markup for the placeholders is not fixed, it is ok if another library needs syntactical changes.</p>
  
  <p>This small tests shows the problem:</p>
  
  <pre><code>SimpleDateFormat            formatter   = new SimpleDateFormat("yyyyMMdd");
  
  String                      template    = ".../uploads/${customer}/${dateTime('yyyyMMdd')}/report.pdf";
  
  @Test
  public void shouldResolvePlaceholder()
  {
      final Map&lt;String, String&gt; model = new HashMap&lt;String, String&gt;();
      model.put("customer", "Mr. Foobar");
  
      final String filledTemplate = StrSubstitutor.replace(this.template, model);
  
      assertEquals(".../uploads/Mr. Foobar/" + this.formatter.format(new Date()) + "/report.pdf", filledTemplate);
  }
  </code></pre>