Getting "Freemarker template Error" while using <@s.generator and iterator tags
<p>I am learning Struts 2. While creating views using FreeMarker template, I am getting an error. I am using Eclipse IDE and running the application in Tomcat 8.</p>

<p>Freemarker Code:</p>

<pre><code>    &lt;!DOCTYPE html&gt;
    &lt;html&gt;
    &lt;head&gt;
        &lt;meta charset="UTF-8"&gt;
    &lt;title&gt;Insert title here&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;h1&gt;Sample...(FreeMarker)&lt;/h1&gt;&lt;br&gt;&lt;br&gt;      
        &lt;div&gt;
            &lt;@s.generator separator="," val="%{'15,20,30,40,50'}"&gt;
                Last entered protein Values -:&lt;br&gt;
                &lt;@s.iterator&gt;
                    &lt;@s.property /&gt;&lt;br&gt;
                &lt;/@s.iterator&gt; 
            &lt;/@s.generator&gt; 
        &lt;/div&gt;      
    &lt;/body&gt;
    &lt;/html&gt;
</code></pre>

<p>Eclipse Console Trace Log:</p>

<pre><code>    &gt; Jul 14, 2016 8:19:02 PM
    &gt; com.opensymphony.xwork2.util.logging.jdk.JdkLogger error SEVERE:
    &gt; Exception occurred during processing request: The following has
    &gt; evaluated to null or missing:
    &gt; ==&gt; s.generator  [in template "WEB-INF/content/enter-protein.ftl" at line 10, column 11]
    &gt; 
    &gt; ---- Tip: It's the step after the last dot that caused this error, not those before it.
    &gt; ---- Tip: If the failing expression is known to be legally refer to something that's null or missing, either specify a default value like
    &gt; myOptionalVar!myDefault, or use &lt;#if
    &gt; myOptionalVar??&gt;when-present&lt;#else&gt;when-missing&lt;/#if&gt;. (These only
    &gt; cover the last step of the expression; to cover the whole expression,
    &gt; use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
    &gt; ----
    &gt; 
    &gt; ---- FTL stack trace ("~" means nesting-related):
    &gt;   - Failed at: @s.generator separator="," val="%{'15...  [in template "WEB-INF/content/enter-protein.ftl" at line 16, column 9]
    &gt; ---- FreeMarker template error: The following has evaluated to null or missing:
    &gt; ==&gt; s.generator  [in template "WEB-INF/content/enter-protein.ftl" at line 16, column 11]
    &gt; 
    &gt; ---- Tip: It's the step after the last dot that caused this error, not those before it.
    &gt; ---- Tip: If the failing expression is known to be legally refer to something that's null or missing, either specify a default value like
    &gt; myOptionalVar!myDefault, or use &lt;#if
    &gt; myOptionalVar??&gt;when-present&lt;#else&gt;when-missing&lt;/#if&gt;. (These only
    &gt; cover the last step of the expression; to cover the whole expression,
    &gt; use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
    &gt; ----
    &gt; 
    &gt; ---- FTL stack trace ("~" means nesting-related):
    &gt;   - Failed at: @s.generator separator="," val="%{'15...  [in template "WEB-INF/content/enter-protein.ftl" at line 16, column 9]
    &gt; ----
    &gt; 
    &gt; Java stack trace (for programmers):
    &gt; ---- freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...]     at
    &gt; freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:116)
    &gt;   at freemarker.core.UnifiedCall.accept(UnifiedCall.java:112)     at
    &gt; freemarker.core.Environment.visit(Environment.java:312)   at
    &gt; freemarker.core.MixedContent.accept(MixedContent.java:62)     at
    &gt; freemarker.core.Environment.visit(Environment.java:312)   at
    &gt; freemarker.core.Environment.process(Environment.java:290)     at
    &gt; freemarker.template.Template.process(Template.java:312)   at
    &gt; org.apache.struts2.views.freemarker.FreemarkerResult.doExecute(FreemarkerResult.java:223)
    &gt;   at
    &gt; org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:191)   at
.
.
.
.
    ........................ So on...........
</code></pre>

<p>Weird thing is, when I try the same in JSP, it works flawlessly!
(In JSP, we use <code>&lt;s:something&gt;</code> instead of <code>&lt;@s.something&gt;</code> )</p>