title: freemarker - variable name with dot
body: <p>Is it possible to refer a variable that contains dot in a freemarker template? (or '-' character)</p>
  
  <p>e.g.:</p>
  
  <p>Main.java:</p>
  
  <pre><code>public class Main {
      public static void main(String[] args) throws IOException, TemplateException {
          Configuration freemarkerConfig = new Configuration();
          freemarkerConfig.setClassForTemplateLoading(Main.class, "");
          Template template = freemarkerConfig.getTemplate("template.ftl");
  
          Map&lt;String, String&gt; data = new HashMap&lt;String, String&gt;();
          data.put("variable.name", "value");
  
          Writer out = new StringWriter();
          template.process(data, out);
          System.out.println(out.toString());
      }
  }
  </code></pre>
  
  <p>template.ftl:</p>
  
  <pre><code>${variable.name}
  </code></pre>
  
  <p>This code throws exception:</p>
  
  <pre><code>The following has evaluated to null or missing:
  ==&gt; variable  [in template "template.ftl" at line 1, column 3]
  </code></pre>
  
  <p>Is it possible to refer the variable "variable.name" in the tempalte file?</p>