title: Spring Expression Language (SpEL) with @Value: dollar vs. hash ($ vs. #)
body: <p>I'm a little confused concerning when to use <code>${...}</code> compared to <code>#{...}</code>. Spring's documentation only uses <code>#{...}</code>, but there are plenty of examples that use <code>${...}</code>. Furthermore, when I started with SpEL I was told to use <code>${...}</code> and it works fine.</p>
  
  <p>For those who are confused, an example of how I use it would be</p>
  
  <pre><code>@Component
  public class ProxyConfiguration {
  
      @Value("${proxy.host}")
      private String host;
      @Value("${proxy.port}")
      private String port;
  
      :
  }
  </code></pre>
  
  <p>and some property file:</p>
  
  <pre><code>proxy.host=myproxy.host
  proxy.port=8000
  </code></pre>
  
  <p>My questions are:</p>
  
  <ul>
  <li>what are the differences or is it the same?</li>
  <li>is one version deprecated so I should use the other one?</li>
  </ul>