title: Bean Bind to form using Freemarker
body: <p>I try to bind a bean to a form snippet from the form:</p>
  
  <pre><code>[#ftl/]
  [#import "spring.ftl" as spring /]
  [#import "panda.ftl" as panda /]
  
  [#import "discoveryProject.ftl" as discoveryProject/]
  [#macro defineProjectForm newProject]
  [@spring.bind "discoveryProjectDetailsBean"/]
  
  [#if newProject?has_content &amp;&amp; newProject =="true"]
  &lt;table class="transparentTable"&gt;
      &lt;tr&gt;
          &lt;!--Left Part--&gt;
          &lt;td&gt;
              &lt;table&gt;
                  &lt;tr&gt;
                      &lt;td&gt;
                          [@spring.showErrors " " "errors"/]
                          &lt;span&gt;Data Source&lt;sup&gt;&lt;span style="color: red; "&gt;*&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;
                      &lt;/td&gt;
                      &lt;td&gt;
                          &lt;select id="dataSourceSelect" onchange="checkSelectChanges()"&gt;
                              [#if discoveryProjectLookupBean.dataSources?has_content]
                                  [#list discoveryProjectLookupBean.dataSources as dataSource]
                                      &lt;option id="${dataSource.id}" value="${dataSource.name}"&gt;${dataSource.name}&lt;/option&gt;
                                  [/#list]
                              [/#if]
                          &lt;/select&gt;
                      [@spring.bind path="discoveryProjectDetailsBean.discoveryProjectBean.dataSource"/]
                      &lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/table&gt;
  </code></pre>
  
  <p>this is submitted to a controller, snippet to this controller:</p>
  
  <pre><code>@RequestMapping("/navigateDiscoveryProject")
  ModelAndView navigateDiscoveryProject(@RequestParam("index")String i,@RequestParam("direction")String direction,
          @ModelAttribute("discoveryProjectDetailsBean")DiscoveryProjectDetailsBean discoveryProjectDetailsBean,BindingResult result,HttpSession session)throws Exception{
      logger.info("method invoked");
      int index=Integer.parseInt(i);
      //another code
  }
  </code></pre>
  
  <p>the bean <code>discoveryProjectDetailsBean</code> contains property which is actually another bean <code>discoveryProjectBean</code> this bean's properties are always null however I bind them myself in the ftl like in the dataSource property example above, all the values of properties to the <code>discoveryProjectBean</code> are always null. </p>