title: How can I set a FreeMarker variable with an interpolated value? error: "You can't use "${" here as you are already in FreeMarker-expression-mode."?
body: <p>I am absolutly new in <strong>FreeMarker</strong> and I have the following problem working on a Spring MVC application that use this template engine.</p>
  
  <p>So into a controller method I put an int representing the current year (2016) into the <strong>model</strong>, in this way:</p>
  
  <pre><code>model.addAttribute("annoCorrente", annoCorrente);
  </code></pre>
  
  <p>Then, into my FreeMarker page I have to assign this value to a variable, so I write the following expression:</p>
  
  <pre><code>&lt;#assign a = ${annoCorrente}&gt;
  </code></pre>
  
  <p>But in this way I obtain the following error message:</p>
  
  <pre><code>[col. 86] You can't use "${" here as you are already in FreeMarker-expression-mode. Thus, instead of ${myExpression}, just write myExpression. (${...} is only needed where otherwise static text is expected, i.e, outside FreeMarker tags and ${...}-s.)
  </code></pre>
  
  <p>Why? How can I correctly initizialize a FreeMarker variable with the value obtained from the model associated to this view?</p>