title: Passing Parameter to struts2 component
body: <p>I am attempting to create a struts2 component using freemarker. I created an <code>ftl</code> file with code like this:</p>
  
  <pre><code>&lt;script type="text/javascript" src="${parameters.library?default('')}"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Which is expecting a parameter named <code>library</code> to be passed to the component. If the parameter is absent then it defaults to a blank <code>String</code>.</p>
  
  <p>On my JSP page, I am referring to the component like this:</p>
  
  <pre><code>&lt;s:component template="mytemplate.ftl"&gt;
      &lt;s:param name="library" value="/scripts/mylibrary.js"/&gt;
  &lt;/s:component&gt;
  </code></pre>
  
  <p>Unfortunately, the value for the library parameter is not being set. It is always a blank <code>String</code>.</p>
  
  <p>I am using the advice from this <a href="http://www.vitarara.org/cms/struts_2_cookbook/creating_a_ui_component" rel="nofollow noreferrer">tutorial</a> and it seems as if the <code>s:param</code> tag should pass the parameter into the template and make it available. What am I missing here? </p>
  
  <p>Does anyone have some experience building these components that could shed some light?</p>
  
  <p>Thanks.</p>