title: Freemarker - Set and get variable name as empty string
body: <p>According to <a href="https://freemarker.apache.org/docs/app_faq.html#faq_legal_variable_names" rel="nofollow noreferrer">freemarker FAQ</a> I can use any variable name with no limitation:</p>
  
  <blockquote>
    <p>FreeMarker has no limitations regarding the characters used in variable names, nor regarding the length of the variable names</p>
  </blockquote>
  
  <p>How can I define in freemarker a variable name as empty string and reference it as </p>
  
  <pre><code>${} 
  </code></pre>
  
  <p>Exception:</p>
  
  <pre><code>freemarker.core.ParseException: Syntax error in template "test.ftlh" in line 1, column 4:
  Encountered "}", but was expecting one of:
      &lt;STRING_LITERAL&gt;
      &lt;RAW_STRING&gt;
      "false"
      "true"
      &lt;INTEGER&gt;
      &lt;DECIMAL&gt;
      "."
      "+"
      "-"
      "!"
      "["
      "("
      "{"
      &lt;ID&gt;
      at freemarker.core.FMParser.generateParseException(FMParser.java:5749)
      at freemarker.core.FMParser.jj_consume_token(FMParser.java:5608)
      at freemarker.core.FMParser.UnaryExpression(FMParser.java:658)
      at freemarker.core.FMParser.MultiplicativeExpression(FMParser.java:768)
      at freemarker.core.FMParser.AdditiveExpression(FMParser.java:720)
      at freemarker.core.FMParser.RangeExpression(FMParser.java:900)
      at freemarker.core.FMParser.RelationalExpression(FMParser.java:848)
      at freemarker.core.FMParser.EqualityExpression(FMParser.java:811)
      at freemarker.core.FMParser.AndExpression(FMParser.java:967)
      at freemarker.core.FMParser.OrExpression(FMParser.java:989)
      at freemarker.core.FMParser.Expression(FMParser.java:548)
      at freemarker.core.FMParser.StringOutput(FMParser.java:1522)
      at freemarker.core.FMParser.MixedContentElements(FMParser.java:3721)
      at freemarker.core.FMParser.Root(FMParser.java:4411)
      at freemarker.template.Template.&lt;init&gt;(Template.java:252)
      at freemarker.cache.TemplateCache.loadTemplate(TemplateCache.java:549)
      at freemarker.cache.TemplateCache.getTemplateInternal(TemplateCache.java:439)
      at freemarker.cache.TemplateCache.getTemplate(TemplateCache.java:292)
      at freemarker.template.Configuration.getTemplate(Configuration.java:2654)
      at freemarker.template.Configuration.getTemplate(Configuration.java:2503)
      at com.FreemarkerTest.main(FreemarkerTest.java:46)
  </code></pre>
  
  <p>I also tried <code>${""}</code> by assigning empty variable but it ignores the value assigned:</p>
  
  <pre><code>&lt;#assign  ""="aa"&gt;
  ${""}
  </code></pre>
  
  <p>Normally in a map I can assign a variable with empty string and get it.</p>