title: Do we have to add any configurations to get Java object data into freemarker template?
body: <p>Do we have to add any configurations to get Java object data into freemarker template ?
  In my template while using 'If' condition as shown below</p>
  <pre><code>&lt;#if searchForm.frm_searchType == &quot;Non-Member&quot;&gt;
    &lt;#assign isMember = true&gt;
    &lt;#assign isNonMember = false&gt;
  &lt;#else&gt;
    &lt;#assign isMember = false&gt;
    &lt;#assign isNonMember = true&gt;
  &lt;/#if&gt;
  </code></pre>
  <p>Getting this error below</p>
  <pre><code>ERROR [freemarker.runtime] (default task-1) Error executing FreeMarker template: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
  ==&gt; searchForm.frm_searchType  [in template &quot;memberSearch.ftl&quot; at line 83, column 6]
  
  
  Tip: It's the step after the last dot that caused this error, not those before it.
  
  Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use &lt;#if myOptionalVar??&gt;when-present&lt;#else&gt;when-missing&lt;/#if&gt;. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
  
  
  
  FTL stack trace (&quot;~&quot; means nesting-related):
      - Failed at: #if searchForm.frm_searchType == &quot;Non...  [in template &quot;memberSearch.ftl&quot; at line 83, column 1]
  
      at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:134)
      at freemarker.core.EvalUtil.compare(EvalUtil.java:198)
      at freemarker.core.EvalUtil.compare(EvalUtil.java:115)
      at freemarker.core.ComparisonExpression.evalToBoolean(ComparisonExpression.java:78)
      at freemarker.core.IfBlock.accept(IfBlock.java:49)
      at freemarker.core.Environment.visit(Environment.java:347)
      at freemarker.core.Environment.visit(Environment.java:353)
      at freemarker.core.Environment.process(Environment.java:326)
      at freemarker.template.Template.process(Template.java:383)
      at org.springframework.web.servlet.view.freemarker.FreeMarkerView.processTemplate(FreeMarkerView.java:367)
      at org.springframework.web.servlet.view.freemarker.FreeMarkerView.doRender(FreeMarkerView.java:284)
      at org.springframework.web.servlet.view.freemarker.FreeMarkerView.renderMergedTemplateModel(FreeMarkerView.java:234)
      at org.springframework.web.servlet.view.AbstractTemplateView.renderMergedOutputModel(AbstractTemplateView.java:167)
      at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303)
      at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1244)
      at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1027)
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:971)
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
      at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:686)
      at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:791)
      at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
      at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
      at com.cgi.kym.web.filter.ZipFilter.doFilter(ZipFilter.java:45)
      at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
      at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
      at com.cgi.kym.web.filter.SecurityFilter.doFilter(SecurityFilter.java:169)
      at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
      at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
      at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
      at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
      at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
      at
  </code></pre>
  <p>FYI: <code>searchForm</code> and <code>frm_searchType</code> are public. If these two are initially null and will be getting data later, then how to get the template rendered initially.</p>