title: How to access Spring MVC model objects in Freemarker template?
body: <p>New to Spring MVC and FreeMarker framewroks. Followed <a href="http://goo.gl/2xLw5" rel="nofollow">this</a> tutorial to get started with it.<br/>When I tried to add few more model object and access it in freemarker template. But it didn't work. I am completely clueless about accessing model objects into freemarker template.<br/>
  <strong>Controller</strong></p>
  
  <pre><code>@RequestMapping(value = "/index", method = RequestMethod.GET)
      public String index(@ModelAttribute("model") ModelMap model) {
  
          String amount = "Amount";
      Document xml = readProductXML();
      model.addAttribute("users", userList);
      model.addAttribute("sectionName",amount);
  
          return "index";
      }
  </code></pre>
  
  <p><strong>Freemarker</strong></p>
  
  <pre><code>&lt;#import "spring.ftl" as spring /&gt;
     &lt;fieldset&gt;
        &lt;legend&gt;${sectionName}&lt;/legend&gt;
    &lt;/fieldset&gt;
  &lt;/#list&gt;
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <pre><code>The following has evaluated to null or missing:
  ==&gt; sectionName  [in template "index.ftl" at line 28, column 67]
  </code></pre>
  
  <p><strong>XML</strong></p>
  
  <pre><code>&lt;FreeMarkerUI&gt;
      &lt;section name="amount" label="Amount"&gt;
          &lt;field name="firstName" label="First Name" type="text" mandatory="yes"/&gt;
          &lt;field name="lastName" label="Last Name" type="text" mandatory="yes"/&gt;
          &lt;field name="country" label="Country" type="dropdown" codeTableName="country" mandatory="no"/&gt;
      &lt;/section&gt;
  &lt;/FreeMarkerUI&gt;
  </code></pre>